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:
seb
2026-08-03 07:38:38 +02:00
parent c8f8dd3d54
commit a3f8ff0e93
2 changed files with 183 additions and 0 deletions

View File

@@ -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);
}