Add sql query to globally remove a tag

This commit is contained in:
Sam Becker 2023-10-05 09:13:59 -05:00
parent 7a333d7c3e
commit 52fe191d98

View File

@ -132,6 +132,13 @@ export const sqlUpdatePhoto = (photo: PhotoDbInsert) =>
WHERE id=${photo.id}
`;
export const sqlRemovePhotoTag = (tag: string) =>
sql`
UPDATE photos
SET tags=array_remove(tags, ${tag})
WHERE ${tag}=ANY(tags)
`;
export const sqlDeletePhoto = (id: string) =>
sql`DELETE FROM photos WHERE id=${id}`;