mirror of
https://github.com/kou029w/_.git
synced 2025-01-31 14:28:04 +00:00
10 lines
299 B
TypeScript
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)
|
|
})
|
|
}))
|