feat(doctors): add doctors management, image optimization, testimonials section and clean fallbacks
Deploy Canina / deploy (push) Has been cancelled
Deploy Canina / deploy (push) Has been cancelled
This commit is contained in:
1 parent
308338ec47
commit
813c96742d
17 files changed
+1135
-170
No files matched your search
@@ -0,0 +1,60 @@
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Put,
|
||||
Delete,
|
||||
Body,
|
||||
Param,
|
||||
Query,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { DoctorsService, DoctorQuery } from './doctors.service';
|
||||
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
||||
import { Prisma } from '@prisma/client';
|
||||
|
||||
@ApiTags('Doctors')
|
||||
@Controller('doctors')
|
||||
export class DoctorsController {
|
||||
constructor(private readonly doctorsService: DoctorsService) {}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'Get list of all doctors / specialists' })
|
||||
findAll(@Query() query: DoctorQuery) {
|
||||
return this.doctorsService.findAll(query);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@ApiOperation({ summary: 'Get doctor by ID with their videos and CV' })
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.doctorsService.findOne(id);
|
||||
}
|
||||
|
||||
@Post()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Create new doctor' })
|
||||
create(@Body() createDoctorDto: Prisma.DoctorCreateInput) {
|
||||
return this.doctorsService.create(createDoctorDto);
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Update doctor' })
|
||||
update(
|
||||
@Param('id') id: string,
|
||||
@Body() updateDoctorDto: Prisma.DoctorUpdateInput,
|
||||
) {
|
||||
return this.doctorsService.update(id, updateDoctorDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Delete doctor' })
|
||||
remove(@Param('id') id: string) {
|
||||
return this.doctorsService.remove(id);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user