feat: restock service
This commit is contained in:
1 parent
c3bc8c98b4
commit
8bd5fa8212
8 files changed
+306
-469
No files matched your search
@@ -83,20 +83,24 @@ class ClaimItemService extends BaseService {
|
||||
)
|
||||
}
|
||||
|
||||
const claimTagRepo = manager.getCustomRepository(this.claimTagRepository_)
|
||||
const tagsToAdd = await Promise.all(
|
||||
tags.map(async t => {
|
||||
const normalized = t.trim().toLowerCase()
|
||||
const existing = await claimTagRepo.findOne({
|
||||
where: { value: normalized },
|
||||
})
|
||||
if (existing) {
|
||||
return existing
|
||||
}
|
||||
if (tags) {
|
||||
const claimTagRepo = manager.getCustomRepository(
|
||||
this.claimTagRepository_
|
||||
)
|
||||
const tagsToAdd = await Promise.all(
|
||||
tags.map(async t => {
|
||||
const normalized = t.trim().toLowerCase()
|
||||
const existing = await claimTagRepo.findOne({
|
||||
where: { value: normalized },
|
||||
})
|
||||
if (existing) {
|
||||
return existing
|
||||
}
|
||||
|
||||
return claimTagRepo.create({ value: normalized })
|
||||
})
|
||||
)
|
||||
return claimTagRepo.create({ value: normalized })
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
const claimImgRepo = manager.getCustomRepository(
|
||||
this.claimImageRepository_
|
||||
|
||||
Reference in new issue
Block a user