Skip to content

Commit

Permalink
refactor: add 'onConflict'
Browse files Browse the repository at this point in the history
  • Loading branch information
altaywtf committed Dec 12, 2023
1 parent 47fb9cd commit 7efa6a4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/services/ai/generate-episode-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ export const generateEpisodeContent = async ({

const createEpisodeContentQuery = await supabase
.from('episode_content')
.upsert({
episode: episodeId,
text_summary: summary,
transcription: transcript,
user: await getAccountId(),
})
.upsert(
{
episode: episodeId,
text_summary: summary,
transcription: transcript,
user: await getAccountId(),
},
{
onConflict: 'episode',
},
)
.select('*')
.single();

Expand Down

0 comments on commit 7efa6a4

Please sign in to comment.