1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-02-28 19:55:17 +00:00
_/frourio/server/api/user/controller.ts

11 lines
329 B
TypeScript
Raw Permalink 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)
})
}))