fix: upsert dashboards
This commit is contained in:
parent
f4bb0d19eb
commit
5f56ebf880
|
@ -70,8 +70,12 @@ builder.mutationField("createDashboard", (t) =>
|
|||
},
|
||||
resolve: async (parent, args) => {
|
||||
const id = hash(JSON.stringify(args.input.ids));
|
||||
const dashboard = await prisma.dashboard.create({
|
||||
data: {
|
||||
const dashboard = await prisma.dashboard.upsert({
|
||||
where: {
|
||||
id,
|
||||
},
|
||||
update: {},
|
||||
create: {
|
||||
id,
|
||||
title: args.input.title,
|
||||
description: args.input.description || "",
|
||||
|
|
Loading…
Reference in New Issue
Block a user