remove unused
This commit is contained in:
@@ -2,8 +2,7 @@ import { BadRequestException, Injectable, NotFoundException } from '@nestjs/comm
|
||||
import { CreateRestaurantDto } from '../dto/create-restaurant.dto';
|
||||
import { UpdateRestaurantDto } from '../dto/update-restaurant.dto';
|
||||
import { UpgradeSubscriptionDto } from '../dto/upgrade-subscription.dto';
|
||||
import { UpdateSubscriptionDto } from '../dto/update-subscription.dto';
|
||||
import { Restaurant } from '../entities/restaurant.entity';
|
||||
import { Restaurant } from '../entities/restaurant.entity';
|
||||
import { EntityManager } from '@mikro-orm/postgresql';
|
||||
import { RestRepository } from '../repositories/rest.repository';
|
||||
import { RestMessage } from 'src/common/enums/message.enum';
|
||||
@@ -179,18 +178,4 @@ export class RestaurantsService {
|
||||
return restaurant;
|
||||
}
|
||||
|
||||
async updateSubscription(restaurantId: string, dto: UpdateSubscriptionDto): Promise<Restaurant> {
|
||||
const restaurant = await this.restRepository.findOne({ id: restaurantId });
|
||||
|
||||
if (!restaurant) {
|
||||
throw new NotFoundException(RestMessage.NOT_FOUND);
|
||||
}
|
||||
|
||||
restaurant.subscriptionId = dto.subscriptionId;
|
||||
restaurant.subscriptionEndDate = dto.subscriptionEndDate;
|
||||
|
||||
await this.em.persistAndFlush(restaurant);
|
||||
|
||||
return restaurant;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user