forked from Yara724/api
Remove profile plate management and restrict personal profile updates
This commit is contained in:
@@ -1,19 +1,8 @@
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Body,
|
||||
Patch,
|
||||
Param,
|
||||
Delete,
|
||||
UseGuards,
|
||||
} from "@nestjs/common";
|
||||
import { ApiBearerAuth, ApiBody, ApiParam, ApiTags } from "@nestjs/swagger";
|
||||
import { Controller, Get, Body, Patch, UseGuards } from "@nestjs/common";
|
||||
import { ApiBearerAuth, ApiBody, ApiTags } from "@nestjs/swagger";
|
||||
import { GlobalGuard } from "src/auth/guards/global.guard";
|
||||
import { CurrentUser } from "src/decorators/user.decorator";
|
||||
import { Roles } from "src/decorators/roles.decorator";
|
||||
import { PlatesService } from "src/plates/plates.service";
|
||||
import { AddPlateDto, AddPlateProfileDto } from "./dto/user/AddPlateDto";
|
||||
import { UpdateUserProfileDtoRq } from "./dto/user/update-profile.dto";
|
||||
import { ProfileService } from "./profile.service";
|
||||
|
||||
@@ -22,10 +11,7 @@ import { ProfileService } from "./profile.service";
|
||||
@ApiBearerAuth()
|
||||
@Roles()
|
||||
export class ProfileController {
|
||||
constructor(
|
||||
private readonly profileService: ProfileService,
|
||||
private readonly plateService: PlatesService,
|
||||
) {}
|
||||
constructor(private readonly profileService: ProfileService) {}
|
||||
|
||||
@Get()
|
||||
@UseGuards(GlobalGuard)
|
||||
@@ -42,18 +28,4 @@ export class ProfileController {
|
||||
) {
|
||||
return await this.profileService.updateProfile(user.username, body);
|
||||
}
|
||||
|
||||
@Post("plate")
|
||||
@UseGuards(GlobalGuard)
|
||||
@ApiBody({ type: AddPlateProfileDto })
|
||||
async addPlate(@CurrentUser() user, @Body() body: AddPlateDto) {
|
||||
return await this.plateService.addPlate(user.sub, body);
|
||||
}
|
||||
|
||||
@Delete("plate/:id")
|
||||
@UseGuards(GlobalGuard)
|
||||
@ApiParam({ name: "id", required: true })
|
||||
async deletePlate(@Param("id") id) {
|
||||
return await this.plateService.deletePlate(id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user