import { Body, Controller, Get, Inject, Patch, UseGuards } from "@nestjs/common"; import { UsersService } from "./users.service.js"; import { CurrentUser } from "../auth/current-user.decorator.js"; import { ClerkAuthGuard } from "../auth/clerk-auth.guard.js"; @Controller("users") export class UsersController { constructor(@Inject(UsersService) private readonly usersService: UsersService) {} @Get("me") async me(@CurrentUser() userId: string) { return this.usersService.getProfile(userId); } @Patch("me") async updateMe( @CurrentUser() userId: string, @Body() body: { phone?: string; fullName?: string; preferredLanguage?: string }, ) { return this.usersService.updateProfile(userId, body); } @Get("me/missions") async myMissions(@CurrentUser() userId: string) { const items = await this.usersService.listUserMissions(userId); return { items }; } }