farsi messages
This commit is contained in:
@@ -6,6 +6,7 @@ import { CreateDeliveryDto } from '../dto/create-delivery.dto';
|
||||
import { UpdateDeliveryDto } from '../dto/update-delivery.dto';
|
||||
import { RestRepository } from '../../restaurants/repositories/rest.repository';
|
||||
import { DeliveryMethodEnum } from '../interface/delivery';
|
||||
import { DeliveryMessage } from 'src/common/enums/message.enum';
|
||||
|
||||
@Injectable()
|
||||
export class DeliveryService {
|
||||
@@ -18,7 +19,7 @@ export class DeliveryService {
|
||||
async create(restId: string, createDto: CreateDeliveryDto): Promise<Delivery> {
|
||||
const restaurant = await this.restRepository.findOne({ id: restId });
|
||||
if (!restaurant) {
|
||||
throw new NotFoundException(`رستوران با شناسه ${restId} یافت نشد.`);
|
||||
throw new NotFoundException(DeliveryMessage.RESTAURANT_NOT_FOUND);
|
||||
}
|
||||
|
||||
// Check if the delivery method with the same name already exists for this restaurant
|
||||
@@ -60,7 +61,7 @@ export class DeliveryService {
|
||||
});
|
||||
|
||||
if (!delivery) {
|
||||
throw new NotFoundException(`روش ارسال با شناسه ${deliveryId} برای رستوران با شناسه ${restId} یافت نشد.`);
|
||||
throw new NotFoundException(DeliveryMessage.DELIVERY_METHOD_NOT_FOUND);
|
||||
}
|
||||
|
||||
return delivery;
|
||||
@@ -73,7 +74,7 @@ export class DeliveryService {
|
||||
});
|
||||
|
||||
if (!delivery) {
|
||||
throw new NotFoundException(`روش ارسال با شناسه ${deliveryId} برای رستوران با شناسه ${restId} یافت نشد.`);
|
||||
throw new NotFoundException(DeliveryMessage.DELIVERY_METHOD_NOT_FOUND);
|
||||
}
|
||||
|
||||
// If method is being updated, check for conflicts
|
||||
@@ -102,7 +103,7 @@ export class DeliveryService {
|
||||
});
|
||||
|
||||
if (!delivery) {
|
||||
throw new NotFoundException(`روش ارسال با شناسه ${deliveryId} برای رستوران با شناسه ${restId} یافت نشد.`);
|
||||
throw new NotFoundException(DeliveryMessage.DELIVERY_METHOD_NOT_FOUND);
|
||||
}
|
||||
|
||||
await this.em.removeAndFlush(delivery);
|
||||
|
||||
Reference in New Issue
Block a user