refactor: move shift index into transaction
This commit is contained in:
@@ -733,11 +733,6 @@ export const cardRouter = createTRPCRouter({
|
||||
code: "INTERNAL_SERVER_ERROR",
|
||||
});
|
||||
|
||||
await cardRepo.shiftIndex(ctx.supabaseClient, {
|
||||
listId: card.list.id,
|
||||
cardIndex: card.index,
|
||||
});
|
||||
|
||||
await cardActivityRepo.create(ctx.db, {
|
||||
type: "card.archived",
|
||||
cardId: card.id,
|
||||
|
||||
@@ -133,11 +133,6 @@ export const listRouter = createTRPCRouter({
|
||||
|
||||
await activityRepo.bulkCreate(ctx.db, activities);
|
||||
|
||||
await listRepo.shiftIndex(ctx.supabaseClient, {
|
||||
boardId: list.boardId,
|
||||
listIndex: list.index,
|
||||
});
|
||||
|
||||
return { success: true };
|
||||
}),
|
||||
update: protectedProcedure
|
||||
|
||||
Reference in New Issue
Block a user