up
This commit is contained in:
@@ -10,6 +10,7 @@ import { TokensService } from './services/tokens.service';
|
||||
import { RestaurantsModule } from '../restaurants/restaurants.module';
|
||||
import { MikroOrmModule } from '@mikro-orm/nestjs';
|
||||
import { User } from '../users/entities/user.entity';
|
||||
import { AdminAuthController } from './controllers/admin-auth.controller';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
@@ -29,7 +30,7 @@ import { User } from '../users/entities/user.entity';
|
||||
RestaurantsModule,
|
||||
MikroOrmModule.forFeature([User]),
|
||||
],
|
||||
controllers: [AuthController],
|
||||
controllers: [AuthController, AdminAuthController],
|
||||
providers: [AuthService, TokensService],
|
||||
})
|
||||
export class AuthModule {}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { RefreshTokenDto } from '../dto/refresh-token.dto';
|
||||
|
||||
@ApiTags('admin/auth')
|
||||
@Controller('admin/auth')
|
||||
export class AuthController {
|
||||
export class AdminAuthController {
|
||||
constructor(private readonly authService: AuthService) {}
|
||||
|
||||
@Throttle({ default: { limit: 3, ttl: 180_000 } })
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { Controller, Get, Post, Body, Patch, Param } from '@nestjs/common';
|
||||
import { RestaurantsService } from './restaurants.service';
|
||||
import { CreateRestaurantDto } from './dto/create-restaurant.dto';
|
||||
import { UpdateRestaurantDto } from './dto/update-restaurant.dto';
|
||||
|
||||
@Controller('restaurants')
|
||||
@Controller('admin/restaurants')
|
||||
export class RestaurantsController {
|
||||
constructor(private readonly restaurantsService: RestaurantsService) {}
|
||||
|
||||
@@ -26,9 +26,4 @@ export class RestaurantsController {
|
||||
update(@Param('id') id: string, @Body() updateRestaurantDto: UpdateRestaurantDto) {
|
||||
return this.restaurantsService.update(id, updateRestaurantDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.restaurantsService.remove(+id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user