update rest

This commit is contained in:
2026-01-05 20:14:29 +03:30
parent 16ab3e668d
commit 69921e1bf9
@@ -2,7 +2,7 @@ import { BadRequestException, Injectable, NotFoundException } from '@nestjs/comm
import { CreateRestaurantDto } from '../dto/create-restaurant.dto'; import { CreateRestaurantDto } from '../dto/create-restaurant.dto';
import { UpdateRestaurantDto } from '../dto/update-restaurant.dto'; import { UpdateRestaurantDto } from '../dto/update-restaurant.dto';
import { UpgradeSubscriptionDto } from '../dto/upgrade-subscription.dto'; import { UpgradeSubscriptionDto } from '../dto/upgrade-subscription.dto';
import { Restaurant } from '../entities/restaurant.entity'; import { Restaurant } from '../entities/restaurant.entity';
import { EntityManager } from '@mikro-orm/postgresql'; import { EntityManager } from '@mikro-orm/postgresql';
import { RestRepository } from '../repositories/rest.repository'; import { RestRepository } from '../repositories/rest.repository';
import { RestMessage } from 'src/common/enums/message.enum'; import { RestMessage } from 'src/common/enums/message.enum';
@@ -136,7 +136,8 @@ export class RestaurantsService {
} }
async update(id: string, dto: UpdateRestaurantDto): Promise<Restaurant> { async update(id: string, dto: UpdateRestaurantDto): Promise<Restaurant> {
const restaurant = await this.restRepository.findOne({ id });
const restaurant = await this.restRepository.findOne({ id: id });
if (!restaurant) { if (!restaurant) {
throw new NotFoundException(RestMessage.NOT_FOUND); throw new NotFoundException(RestMessage.NOT_FOUND);