feat: select position when creating a new card
This commit is contained in:
@@ -83,7 +83,7 @@ export const destroy = async (
|
||||
const result = await db
|
||||
.from("card")
|
||||
.update({ deletedAt: args.deletedAt, deletedBy: args.deletedBy })
|
||||
.eq("publicId", args.cardId);
|
||||
.eq("id", args.cardId);
|
||||
|
||||
return result;
|
||||
};
|
||||
@@ -327,3 +327,18 @@ export const shiftIndex = async (
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
export const pushIndex = async (
|
||||
db: SupabaseClient<Database>,
|
||||
args: {
|
||||
listId: number;
|
||||
cardIndex: number;
|
||||
},
|
||||
) => {
|
||||
const { data } = await db.rpc("push_card_index", {
|
||||
list_id: args.listId,
|
||||
card_index: args.cardIndex,
|
||||
});
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user