feat: delete comments

This commit is contained in:
Henry
2025-02-20 21:45:32 +00:00
parent 95aa23056b
commit cf31c50f46
9 changed files with 239 additions and 21 deletions

View File

@@ -302,6 +302,7 @@ export const getWithListAndMembersByPublicId = async (
.is("deletedAt", null)
.is("list.board.lists.deletedAt", null)
.is("list.board.workspace.members.deletedAt", null)
.is("activities.comment.deletedAt", null)
.order("index", { referencedTable: "list.board.lists", ascending: true })
.is("members.deletedAt", null)
.limit(1)

View File

@@ -61,3 +61,23 @@ export const update = async (
return data;
};
export const softDelete = async (
db: SupabaseClient<Database>,
args: {
commentId: number;
deletedAt: string;
deletedBy: string;
},
) => {
const { data } = await db
.from("card_comments")
.update({ deletedAt: args.deletedAt, deletedBy: args.deletedBy })
.eq("id", args.commentId)
.select(`id`)
.order("id", { ascending: true })
.limit(1)
.single();
return data;
};