feat: delete labels
This commit is contained in:
@@ -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 },
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user