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