🚑 hotfix: update all section that need uuidv7
This commit is contained in:
@ -1,14 +1,18 @@
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { AppError } from "../../../helpers/error/instances/app";
|
||||
import { prisma } from "../../../utils/databases/prisma/connection";
|
||||
import { generateUUIDv7 } from "../../../helpers/databases/uuidv7";
|
||||
|
||||
export const bulkInsertCharactersRepository = async (
|
||||
payload: Prisma.CharacterUpsertArgs["create"],
|
||||
payload: Omit<Prisma.CharacterUncheckedCreateInput, "id">,
|
||||
) => {
|
||||
try {
|
||||
return await prisma.character.upsert({
|
||||
where: { malId: payload.malId },
|
||||
create: payload,
|
||||
create: {
|
||||
id: generateUUIDv7(),
|
||||
...payload,
|
||||
},
|
||||
update: payload,
|
||||
select: { id: true },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user