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

11 lines
329 B
TypeScript
Raw Normal View History

2020-10-12 13:35:33 +09:00
import { defineController } from './$relay'
import { getUserInfoById, changeIcon } from '$/service/user'
export default defineController(() => ({
get: ({ user }) => ({ status: 200, body: getUserInfoById(user.id) }),
post: async ({ user, body }) => ({
status: 201,
body: await changeIcon(user.id, body.icon)
})
}))