feat: restock service

This commit is contained in:
Sebastian Rindom committed 2021-03-26 12:44:55 +01:00
1 parent c3bc8c98b4
commit 8bd5fa8212
8 files changed
+306 -469

No files matched your search

+17 -13
View File
@@ -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_