feat: delete labels

This commit is contained in:
Henry
2024-08-28 21:18:20 +01:00
parent 677981bfef
commit 5c8a1c5069
7 changed files with 107 additions and 7 deletions

View File

@@ -181,6 +181,15 @@ export const destroyCardLabelRelationship = async (
return result;
};
export const destroyAllCardLabelRelationships = async (
db: SupabaseClient<Database>,
labelId: number,
) => {
const result = await db.from("_card_labels").delete().eq("labelId", labelId);
return result;
};
export const createCardLabelRelationship = async (
db: SupabaseClient<Database>,
cardLabelRelationshipInput: { cardId: number; labelId: number },

View File

@@ -78,3 +78,12 @@ export const update = async (
return data;
};
export const destroy = async (
db: SupabaseClient<Database>,
labelId: number,
) => {
const { data } = await db.from("label").delete().eq("id", labelId);
return data;
};