mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Compare labels with lower cased
This commit is contained in:
parent
16a058dc26
commit
5ce4bf7171
1 changed files with 6 additions and 2 deletions
|
|
@ -129,8 +129,12 @@ export const createLabels = async (
|
|||
})
|
||||
.getMany()
|
||||
|
||||
const existingLabels = labelEntities.map((l) => l.name)
|
||||
const newLabels = labels.filter((l) => !existingLabels.includes(l.name))
|
||||
const existingLabelsInLowerCase = labelEntities.map((l) =>
|
||||
l.name.toLowerCase()
|
||||
)
|
||||
const newLabels = labels.filter(
|
||||
(l) => !existingLabelsInLowerCase.includes(l.name.toLowerCase())
|
||||
)
|
||||
// create new labels
|
||||
const newLabelEntities = await getRepository(Label).save(
|
||||
newLabels.map((l) => ({
|
||||
|
|
|
|||
Loading…
Reference in a new issue