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

10 lines
329 B
TypeScript

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)
})
}))