Skip to content

Commit

Permalink
fix(dashboard): 🚑️ Duplicate typebot
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 23, 2022
1 parent b6618ba commit aca7d68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/builder/services/typebots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ export const importTypebot = async (typebot: Typebot) =>
})

export const duplicateTypebot = async (typebotId: string) => {
const { data: typebotToDuplicate } = await getTypebot(typebotId)
const { data } = await getTypebot(typebotId)
const typebotToDuplicate = data?.typebot
if (!typebotToDuplicate) return { error: new Error('Typebot not found') }
const duplicatedTypebot: Omit<Typebot, 'id'> = omit(
{
Expand All @@ -108,6 +109,7 @@ export const duplicateTypebot = async (typebotId: string) => {
},
'id'
)
console.log(duplicatedTypebot)
return sendRequest<Typebot>({
url: `/api/typebots`,
method: 'POST',
Expand All @@ -116,7 +118,7 @@ export const duplicateTypebot = async (typebotId: string) => {
}

const getTypebot = (typebotId: string) =>
sendRequest<Typebot>({
sendRequest<{ typebot: Typebot }>({
url: `/api/typebots/${typebotId}`,
method: 'GET',
})
Expand Down

2 comments on commit aca7d68

@vercel
Copy link

@vercel vercel bot commented on aca7d68 Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on aca7d68 Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-typebot-io.vercel.app
app.typebot.io
builder-v2-git-main-typebot-io.vercel.app

Please sign in to comment.