| import { | |
| Body, | |
| Controller, | |
| Delete, | |
| Get, | |
| Param, | |
| Post, | |
| Put, | |
| } from '@nestjs/common'; | |
| import { GetOrgFromRequest } from '@gitroom/nestjs-libraries/user/org.from.request'; | |
| import { Organization } from '@prisma/client'; | |
| import { ApiTags } from '@nestjs/swagger'; | |
| import { SetsService } from '@gitroom/nestjs-libraries/database/prisma/sets/sets.service'; | |
| import { | |
| UpdateSetsDto, | |
| SetsDto, | |
| } from '@gitroom/nestjs-libraries/dtos/sets/sets.dto'; | |
| ('Sets') | |
| ('/sets') | |
| export class SetsController { | |
| constructor(private _setsService: SetsService) {} | |
| ('/') | |
| async getSets(() org: Organization) { | |
| return this._setsService.getSets(org.id); | |
| } | |
| ('/') | |
| async createASet( | |
| () org: Organization, | |
| () body: SetsDto | |
| ) { | |
| return this._setsService.createSet(org.id, body); | |
| } | |
| ('/') | |
| async updateSet( | |
| () org: Organization, | |
| () body: UpdateSetsDto | |
| ) { | |
| return this._setsService.createSet(org.id, body); | |
| } | |
| ('/:id') | |
| async deleteSet( | |
| () org: Organization, | |
| ('id') id: string | |
| ) { | |
| return this._setsService.deleteSet(org.id, id); | |
| } | |
| } |