This commit is contained in:
1 parent
8783de17cd
commit
8c26a5fd88
7 files changed
+8
-8
No files matched your search
@@ -454,7 +454,7 @@ class OrderService extends BaseService {
|
|||||||
const exists = await this.existsByCartId(cart.id)
|
const exists = await this.existsByCartId(cart.id)
|
||||||
if (exists) {
|
if (exists) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.INVALID_ARGUMENT,
|
MedusaError.Types.DUPLICATE_ERROR,
|
||||||
"Order from cart already exists"
|
"Order from cart already exists"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class ProductVariantService extends BaseService {
|
|||||||
|
|
||||||
if (variantExists) {
|
if (variantExists) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.INVALID_DATA,
|
MedusaError.Types.DUPLICATE_ERROR,
|
||||||
`Variant with title ${variantExists.title} with provided options already exists`
|
`Variant with title ${variantExists.title} with provided options already exists`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -492,7 +492,7 @@ class ProductService extends BaseService {
|
|||||||
|
|
||||||
if (product.options.find(o => o.title === optionTitle)) {
|
if (product.options.find(o => o.title === optionTitle)) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.INVALID_DATA,
|
MedusaError.Types.DUPLICATE_ERROR,
|
||||||
`An option with the title: ${optionTitle} already exists`
|
`An option with the title: ${optionTitle} already exists`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -631,7 +631,7 @@ class ProductService extends BaseService {
|
|||||||
if (!productOption) {
|
if (!productOption) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.NOT_FOUND,
|
MedusaError.Types.NOT_FOUND,
|
||||||
`Option with id: ${optionId} deos not exists`
|
`Option with id: ${optionId} does not exists`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ class RegionService extends BaseService {
|
|||||||
|
|
||||||
if (country.region_id && country.region_id !== regionId) {
|
if (country.region_id && country.region_id !== regionId) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.NOT_ALLOWED,
|
MedusaError.Types.DUPLICATE_ERROR,
|
||||||
`${country.name} already exists in ${country.name}, delete it in that region before adding it`
|
`${country.name} already exists in ${country.name}, delete it in that region before adding it`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -523,7 +523,7 @@ class ShippingOptionService extends BaseService {
|
|||||||
|
|
||||||
if (option.requirements.find(r => r.type === validatedReq.type)) {
|
if (option.requirements.find(r => r.type === validatedReq.type)) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.INVALID_DATA,
|
MedusaError.Types.DUPLICATE_ERROR,
|
||||||
`A requirement with type: ${validatedReq.type} already exists`
|
`A requirement with type: ${validatedReq.type} already exists`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ class StoreService extends BaseService {
|
|||||||
|
|
||||||
if (store.currencies.map(c => c.code).includes(curr.code.toLowerCase())) {
|
if (store.currencies.map(c => c.code).includes(curr.code.toLowerCase())) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.INVALID_DATA,
|
MedusaError.Types.DUPLICATE_ERROR,
|
||||||
`Currency already added`
|
`Currency already added`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ class SwapService extends BaseService {
|
|||||||
|
|
||||||
if (swap.cart_id) {
|
if (swap.cart_id) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.NOT_ALLOWED,
|
MedusaError.Types.DUPLICATE_ERROR,
|
||||||
"A cart has already been created for the swap"
|
"A cart has already been created for the swap"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user