Compare labels with lower cased

This commit is contained in:
Hongbo Wu 2023-04-20 09:38:04 +08:00
parent 16a058dc26
commit 5ce4bf7171

View file

@ -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) => ({