chore: merge develop
This commit is contained in:
@@ -35,6 +35,7 @@ describe("POST /admin/discounts/:discount_id/regions/:region_id", () => {
|
||||
"id",
|
||||
"code",
|
||||
"is_dynamic",
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"starts_at",
|
||||
|
||||
@@ -35,6 +35,7 @@ describe("POST /admin/discounts/:discount_id/variants/:variant_id", () => {
|
||||
"id",
|
||||
"code",
|
||||
"is_dynamic",
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"starts_at",
|
||||
|
||||
@@ -6,6 +6,7 @@ const defaultFields = [
|
||||
"id",
|
||||
"code",
|
||||
"is_dynamic",
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"starts_at",
|
||||
|
||||
@@ -6,6 +6,7 @@ const defaultFields = [
|
||||
"id",
|
||||
"code",
|
||||
"is_dynamic",
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"starts_at",
|
||||
|
||||
@@ -6,6 +6,7 @@ const defaultFields = [
|
||||
"id",
|
||||
"code",
|
||||
"is_dynamic",
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"starts_at",
|
||||
|
||||
@@ -59,6 +59,7 @@ export const defaultFields = [
|
||||
"id",
|
||||
"code",
|
||||
"is_dynamic",
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"starts_at",
|
||||
|
||||
@@ -83,11 +83,12 @@ class ClaimItemService extends BaseService {
|
||||
)
|
||||
}
|
||||
|
||||
if (tags) {
|
||||
let tagsToAdd = []
|
||||
if (tags && tags.length) {
|
||||
const claimTagRepo = manager.getCustomRepository(
|
||||
this.claimTagRepository_
|
||||
)
|
||||
const tagsToAdd = await Promise.all(
|
||||
tagsToAdd = await Promise.all(
|
||||
tags.map(async t => {
|
||||
const normalized = t.trim().toLowerCase()
|
||||
const existing = await claimTagRepo.findOne({
|
||||
@@ -96,18 +97,20 @@ class ClaimItemService extends BaseService {
|
||||
if (existing) {
|
||||
return existing
|
||||
}
|
||||
|
||||
return claimTagRepo.create({ value: normalized })
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
const claimImgRepo = manager.getCustomRepository(
|
||||
this.claimImageRepository_
|
||||
)
|
||||
const imagesToAdd = images.map(url => {
|
||||
return claimImgRepo.create({ url })
|
||||
})
|
||||
let imagesToAdd = []
|
||||
if (images && images.length) {
|
||||
const claimImgRepo = manager.getCustomRepository(
|
||||
this.claimImageRepository_
|
||||
)
|
||||
imagesToAdd = images.map(url => {
|
||||
return claimImgRepo.create({ url })
|
||||
})
|
||||
}
|
||||
|
||||
const created = ciRepo.create({
|
||||
...rest,
|
||||
|
||||
Reference in New Issue
Block a user