Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Fix updating kits failing when going through upsert flow #331

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions apps/web/src/server/services/channels/kits/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ export const upsertKit = async ({
youtubeUrl: kit.youtubeUrl
}

// Remove options from kit when updating so upsert can work correctly
if (kit.id) {
await prisma.warzoneKit.update({
where: { id: kit.id ?? "" },
data: {
options: {
set: []
}
}
})
}

const channel = await prisma.warzoneKit.upsert({
where: { id: kit.id ?? "" },
Expand Down