1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-31 22:38:06 +00:00
_/frourio/server/api/tasks/_taskId@number/controller.ts

14 lines
361 B
TypeScript
Raw Normal View History

2020-10-12 13:35:33 +09:00
import { defineController } from './$relay'
import { updateTask, deleteTask } from '$/service/tasks'
export default defineController(() => ({
patch: async ({ body, params }) => {
await updateTask(params.taskId, body)
return { status: 204 }
},
delete: async ({ params }) => {
await deleteTask(params.taskId)
return { status: 204 }
}
}))