1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-31 14:28:04 +00:00
_/frourio/server/api/tasks/controller.ts

10 lines
299 B
TypeScript

import { defineController } from './$relay'
import { getTasks, createTask } from '$/service/tasks'
export default defineController(() => ({
get: async () => ({ status: 200, body: await getTasks() }),
post: async ({ body }) => ({
status: 201,
body: await createTask(body.label)
})
}))