Files
plp/apps/api/src/profile/profile.controller.ts
T
2026-09-15 01:28:11 +08:00

30 lines
851 B
TypeScript

import { Body, Controller, Inject, Patch, UseGuards } from "@nestjs/common";
import { AuthGuard } from "../auth/auth.guard.js";
import { CurrentUser } from "../auth/current-user.decorator.js";
import type { AccessClaims } from "../auth/token.service.js";
import { UpdateAnonymousProfileDto } from "./dto.js";
import { ProfileService } from "./profile.service.js";
@Controller("me/anonymous-profile")
@UseGuards(AuthGuard)
export class ProfileController {
constructor(
@Inject(ProfileService) private readonly profiles: ProfileService,
) {}
@Patch()
update(
@CurrentUser() user: AccessClaims,
@Body() input: UpdateAnonymousProfileDto,
) {
return this.profiles.update(user.sub, input);
}
}
Reflect.defineMetadata(
"design:paramtypes",
[Object, UpdateAnonymousProfileDto],
ProfileController.prototype,
"update",
);