add:create restuarant endpoint for dmenu
This commit is contained in:
@@ -9,6 +9,7 @@ import { UpdateIconDto } from "./DTO/update-icon.dto";
|
||||
import { CreateGroupDto } from "./DTO/create-group.dto";
|
||||
import { UpdateGroupDto } from "./DTO/update-group.dto";
|
||||
import { FindRestaurantsDto } from "./DTO/find-restaurants.dto";
|
||||
import { CreateRestaurantDto } from "./DTO/create-restaurant.dto";
|
||||
import { AuthGuards } from "../../common/decorators/auth-guard.decorator";
|
||||
import { PermissionsDec } from "../../common/decorators/permission.decorator";
|
||||
import { PermissionEnum } from "../users/enums/permission.enum";
|
||||
@@ -23,7 +24,7 @@ export class DmenuController {
|
||||
private readonly iconsService: IconsService,
|
||||
private readonly contactService: ContactService,
|
||||
private readonly restaurantService: RestaurantService,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
// Icon endpoints
|
||||
@Post('icons')
|
||||
@@ -102,9 +103,16 @@ export class DmenuController {
|
||||
return this.contactService.findOne(+id);
|
||||
}
|
||||
|
||||
// restaurant
|
||||
@Get('restaurants')
|
||||
@ApiOperation({ summary: "Get all restaurants" })
|
||||
findAllRestaurant(@Query() queryDto: FindRestaurantsDto) {
|
||||
return this.restaurantService.findAll(queryDto);
|
||||
}
|
||||
|
||||
@Post('restaurants')
|
||||
@ApiOperation({ summary: "Create restaurant" })
|
||||
createRestaurant(@Body() dto: CreateRestaurantDto) {
|
||||
return this.restaurantService.createRestaurant(dto);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user