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

Commit

Permalink
Merge pull request #331 from kittrgg/fix/upserting-kit-options
Browse files Browse the repository at this point in the history
Fix updating kits failing when going through upsert flow
  • Loading branch information
anthonyshew authored Jul 5, 2022
2 parents f576c58 + e23e2e5 commit bbd8c82
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit bbd8c82

Please sign in to comment.