mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
added format command and added trailing commas to reduce conflicts
This commit is contained in:
@@ -65,7 +65,7 @@ export class MediaController extends Controller {
|
||||
return c.json({
|
||||
type: file?.type,
|
||||
name: file?.name,
|
||||
size: file?.size
|
||||
size: file?.size,
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -82,7 +82,7 @@ export class MediaController extends Controller {
|
||||
if (body.size > maxSize) {
|
||||
return c.json(
|
||||
{ error: `Max size (${maxSize} bytes) exceeded` },
|
||||
HttpStatus.PAYLOAD_TOO_LARGE
|
||||
HttpStatus.PAYLOAD_TOO_LARGE,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -99,8 +99,8 @@ export class MediaController extends Controller {
|
||||
tb(
|
||||
"query",
|
||||
Type.Object({
|
||||
overwrite: Type.Optional(booleanLike)
|
||||
})
|
||||
overwrite: Type.Optional(booleanLike),
|
||||
}),
|
||||
),
|
||||
async (c) => {
|
||||
const entity_name = c.req.param("entity");
|
||||
@@ -124,7 +124,7 @@ export class MediaController extends Controller {
|
||||
const mediaRef = {
|
||||
scope: field_name,
|
||||
reference,
|
||||
entity_id: entity_id
|
||||
entity_id: entity_id,
|
||||
};
|
||||
|
||||
// check max items
|
||||
@@ -140,7 +140,7 @@ export class MediaController extends Controller {
|
||||
if (!overwrite) {
|
||||
return c.json(
|
||||
{ error: `Max items (${max_items}) reached` },
|
||||
HttpStatus.BAD_REQUEST
|
||||
HttpStatus.BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ export class MediaController extends Controller {
|
||||
if (count > max_items) {
|
||||
return c.json(
|
||||
{ error: `Max items (${max_items}) exceeded already with ${count} items.` },
|
||||
HttpStatus.UNPROCESSABLE_ENTITY
|
||||
HttpStatus.UNPROCESSABLE_ENTITY,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -159,9 +159,9 @@ export class MediaController extends Controller {
|
||||
where: mediaRef,
|
||||
sort: {
|
||||
by: "id",
|
||||
dir: "asc"
|
||||
dir: "asc",
|
||||
},
|
||||
limit: count - max_items + 1
|
||||
limit: count - max_items + 1,
|
||||
});
|
||||
|
||||
if (deleteRes.data && deleteRes.data.length > 0) {
|
||||
@@ -175,7 +175,7 @@ export class MediaController extends Controller {
|
||||
if (!exists) {
|
||||
return c.json(
|
||||
{ error: `Entity "${entity_name}" with ID "${entity_id}" doesn't exist found` },
|
||||
HttpStatus.NOT_FOUND
|
||||
HttpStatus.NOT_FOUND,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ export class MediaController extends Controller {
|
||||
if (file.size > maxSize) {
|
||||
return c.json(
|
||||
{ error: `Max size (${maxSize} bytes) exceeded` },
|
||||
HttpStatus.PAYLOAD_TOO_LARGE
|
||||
HttpStatus.PAYLOAD_TOO_LARGE,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ export class MediaController extends Controller {
|
||||
mutator.__unstable_toggleSystemEntityCreation(false);
|
||||
const result = await mutator.insertOne({
|
||||
...this.media.uploadedEventDataToMediaPayload(info),
|
||||
...mediaRef
|
||||
...mediaRef,
|
||||
} as any);
|
||||
mutator.__unstable_toggleSystemEntityCreation(true);
|
||||
|
||||
@@ -210,7 +210,7 @@ export class MediaController extends Controller {
|
||||
}
|
||||
|
||||
return c.json({ ok: true, result: result.data, ...info }, HttpStatus.CREATED);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return hono.all("*", (c) => c.notFound());
|
||||
|
||||
Reference in New Issue
Block a user