scheduale
This commit is contained in:
@@ -65,6 +65,20 @@ export class ScheduleService {
|
||||
return this.scheduleRepository.findOne(where);
|
||||
}
|
||||
|
||||
async findScheduleBySlug(slug: string): Promise<Schedule[]> {
|
||||
const restaurant = await this.em.findOne(Restaurant, { slug });
|
||||
if (!restaurant) {
|
||||
throw new NotFoundException(RestMessage.NOT_FOUND);
|
||||
}
|
||||
|
||||
const where: FilterQuery<Schedule> = {
|
||||
restId: restaurant.id.toString(),
|
||||
isActive: true,
|
||||
};
|
||||
|
||||
return this.scheduleRepository.find(where);
|
||||
}
|
||||
|
||||
async findOne(id: string, restId: string): Promise<Schedule> {
|
||||
const schedule = await this.scheduleRepository.findOne({ id, restId });
|
||||
if (!schedule) {
|
||||
|
||||
Reference in New Issue
Block a user