From 064aafba2a00a4d423915fe3ea5b239b3f29ec16 Mon Sep 17 00:00:00 2001 From: msy7822-ux Date: Wed, 24 May 2023 11:39:28 +0900 Subject: [PATCH] modify suspense insert --- src/app/actions/pai.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/actions/pai.ts b/src/app/actions/pai.ts index e24beac..73e0cee 100644 --- a/src/app/actions/pai.ts +++ b/src/app/actions/pai.ts @@ -5,11 +5,13 @@ import { PaiType } from "@/types/paiType"; import { v4 as uuidv4 } from "uuid"; export const createVote = async (situationId: string, answer: PaiType) => { - const { error } = await supabase.from("votes").insert({ - id: uuidv4(), - situationId: situationId, - answer: answer, - }); + const { error } = await supabase.from("votes").insert([ + { + id: uuidv4(), + situationId: situationId, + answer: answer, + }, + ]); console.log(error); };