import { api } from './_api' ; import type { RequestHandler } from '@sveltejs/kit' ; import type { Locals } from '$lib/types' ; export const get = async ( request ) => { const response = await api ( request , `todos/${ request . locals . userid }` ) ; if ( response . status === 404 ) { return { body : [ ] } ; } return response ; } ; export const post = async ( request ) => { const response = await api ( request , `todos/${ request . locals . userid }` , { text : request . body . get ( 'text' ) } ) ; return response ; } ;