Sorio
Sorio
Explore posts from servers
NNuxt
Created by Sorio on 7/27/2024 in #❓・help
error with the supabase module in server side
Hello 👋 Since a few days, I'm learning to create a backend with nuxt (nitro). I use supabase to store my data. To train myself I've created a to-do list application with a few apis like addToDo, removeToDo ... But I have a typescript error in two of my apis. The one to add a task and the one to switch its value (true false). here the code of the complete.post.ts : import { serverSupabaseUser, serverSupabaseClient } from '#supabase/server' export default defineEventHandler(async (event) => { const user : any = await serverSupabaseUser(event) if (!user) { throw createError({ statusCode: 401, statusMessage: 'Unauthorized' }) } const client = await serverSupabaseClient(event) const body = await readBody(event) const id = body.id const completed = Boolean(body.done) console.log(user.id); const { data } = await client.from('tasks').update({ done: completed }).eq('id', id).select() return data }) And the error : error : Argument of type '{ done: boolean; }' is not assignable to parameter of type 'never'.ts(2345 I hope you'll help me. Thanks in advance 🤗
25 replies
NNuxt
Created by Sorio on 7/11/2024 in #❓・help
Nuxt X Supabase Oauth with Github
No description
7 replies