role perms
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user