messages
This commit is contained in:
@@ -46,7 +46,7 @@ export class ShopService {
|
||||
|
||||
const validateSubscriptionId = await em.findOne(Shop, { subscriptionId: dto.subscriptionId })
|
||||
if (validateSubscriptionId) {
|
||||
throw new BadRequestException("Duplicate subscriptionId: " + dto.subscriptionId)
|
||||
throw new BadRequestException(RestMessage.DUPLICATE_SUBSCRIPTION_ID);
|
||||
}
|
||||
|
||||
// Create shop
|
||||
@@ -64,7 +64,7 @@ export class ShopService {
|
||||
|
||||
const role = await em.findOne(Role, { isSystem: true });
|
||||
if (!role) {
|
||||
throw new BadRequestException(`System role not found`);
|
||||
throw new BadRequestException(RestMessage.SYSTEM_ROLE_NOT_FOUND);
|
||||
}
|
||||
|
||||
const normalizedPhone = normalizePhone(dto.phone);
|
||||
@@ -116,7 +116,7 @@ export class ShopService {
|
||||
const shop = await this.em.findOne(Shop, { slug });
|
||||
|
||||
if (!shop) {
|
||||
throw new NotFoundException(`Shop with slug "${slug}" not found`);
|
||||
throw new NotFoundException(RestMessage.NOT_FOUND);
|
||||
}
|
||||
|
||||
return shop;
|
||||
@@ -235,7 +235,7 @@ export class ShopService {
|
||||
async findOrFail(shopId: string) {
|
||||
const shop = await this.shopRepository.findOne({ id: shopId }, { populate: ['deliveries'] })
|
||||
if (!shop) {
|
||||
throw new BadRequestException("Shop not found")
|
||||
throw new BadRequestException(RestMessage.NOT_FOUND);
|
||||
}
|
||||
return shop
|
||||
}
|
||||
@@ -243,7 +243,7 @@ export class ShopService {
|
||||
async findOrFailBySlug(shopSlug: string) {
|
||||
const shop = await this.shopRepository.findOne({ slug: shopSlug }, { populate: ['deliveries'] })
|
||||
if (!shop) {
|
||||
throw new BadRequestException("Shop not found")
|
||||
throw new BadRequestException(RestMessage.NOT_FOUND);
|
||||
}
|
||||
return shop
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user