feat: add category image upload/delete endpoints
- POST /category/:id/image - upload AVIF image for a category
- DELETE /category/:id/image - remove category image
- Returns { category: { id, fullHash, thumbW, thumbH, thumbHash } }
- Full image stored as-is when AVIF ≤1000x1000, otherwise scaled
- Thumb always scaled to max 200x200
This commit is contained in:
@@ -34,3 +34,13 @@ export async function move({ googleAuthId, id, parentId }) {
|
||||
const store = await getStore();
|
||||
return store.category.move({ googleAuthId, id, parentId });
|
||||
}
|
||||
|
||||
export async function addImage(googleAuthId, categoryId, imageBuffer) {
|
||||
const store = await getStore();
|
||||
return store.category.addImage(googleAuthId, categoryId, imageBuffer);
|
||||
}
|
||||
|
||||
export async function deleteImage(googleAuthId, categoryId) {
|
||||
const store = await getStore();
|
||||
return store.category.deleteImage(googleAuthId, categoryId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user