role perms

This commit is contained in:
2025-11-12 09:28:56 +03:30
parent 046286b559
commit 440c3721ce
31 changed files with 488 additions and 98 deletions
@@ -3,10 +3,16 @@ import { CreateRestaurantDto } from './dto/create-restaurant.dto';
import { UpdateRestaurantDto } from './dto/update-restaurant.dto';
import { Restaurant } from './entities/restaurant.entity';
import { EntityManager } from '@mikro-orm/postgresql';
import { RestRepository } from './repositories/rest.repository';
import { InjectRepository } from '@mikro-orm/nestjs';
@Injectable()
export class RestaurantsService {
constructor(private readonly em: EntityManager) {}
constructor(
private readonly em: EntityManager,
@InjectRepository(Restaurant)
private readonly restRepository: RestRepository,
) {}
async create(dto: CreateRestaurantDto): Promise<Restaurant> {
const restaurant = this.em.create(Restaurant, {
@@ -19,7 +25,7 @@ export class RestaurantsService {
}
findAll() {
return `This action returns all restaurants`;
return this.restRepository.findAll();
}
async findBySlug(slug: string): Promise<Restaurant> {