Add sql query to globally remove a tag
This commit is contained in:
parent
7a333d7c3e
commit
52fe191d98
@ -132,6 +132,13 @@ export const sqlUpdatePhoto = (photo: PhotoDbInsert) =>
|
|||||||
WHERE id=${photo.id}
|
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) =>
|
export const sqlDeletePhoto = (id: string) =>
|
||||||
sql`DELETE FROM photos WHERE id=${id}`;
|
sql`DELETE FROM photos WHERE id=${id}`;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user