edit category from param to query

This commit is contained in:
faris Aljohari
2024-09-15 18:09:34 +03:00
parent d962d4a7b3
commit 5b6dcc1440
4 changed files with 20 additions and 6 deletions
@@ -10,9 +10,14 @@ import {
UseGuards,
Put,
Delete,
Query,
} from '@nestjs/common';
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
import { AddScheduleDto, EnableScheduleDto } from '../dtos/add.schedule.dto';
import {
AddScheduleDto,
EnableScheduleDto,
GetScheduleDeviceDto,
} from '../dtos/schedule.dto';
import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard';
@@ -51,15 +56,15 @@ export class ScheduleController {
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Get(':deviceUuid/category/:category')
@Get(':deviceUuid')
async getDeviceScheduleByCategory(
@Param('deviceUuid') deviceUuid: string,
@Param('category') category: string,
@Query() query: GetScheduleDeviceDto,
) {
try {
return await this.scheduleService.getDeviceScheduleByCategory(
deviceUuid,
category,
query.category,
);
} catch (error) {
throw new HttpException(