mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 20:37:21 +00:00
feat: adding env aware endpoint to obtain sqlite connection, remove libsql hard dependency
This commit is contained in:
@@ -216,7 +216,9 @@ export class MediaController extends Controller {
|
||||
const paths_to_delete: string[] = [];
|
||||
if (max_items) {
|
||||
const { overwrite } = c.req.valid("query");
|
||||
const { count } = await this.media.em.repository(media_entity).count(mediaRef);
|
||||
const {
|
||||
data: { count },
|
||||
} = await this.media.em.repository(media_entity).count(mediaRef);
|
||||
|
||||
// if there are more than or equal to max items
|
||||
if (count >= max_items) {
|
||||
@@ -255,7 +257,9 @@ export class MediaController extends Controller {
|
||||
}
|
||||
|
||||
// check if entity exists in database
|
||||
const { exists } = await this.media.em.repository(entity).exists({ id: entity_id });
|
||||
const {
|
||||
data: { exists },
|
||||
} = await this.media.em.repository(entity).exists({ id: entity_id });
|
||||
if (!exists) {
|
||||
return c.json(
|
||||
{ error: `Entity "${entity_name}" with ID "${entity_id}" doesn't exist found` },
|
||||
|
||||
Reference in New Issue
Block a user