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