mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
insert labels on name conflict do nothing
This commit is contained in:
parent
943db3332e
commit
6e32c1247d
1 changed files with 6 additions and 7 deletions
|
|
@ -73,13 +73,12 @@ export const labelRepository = appDataSource.getRepository(Label).extend({
|
|||
},
|
||||
|
||||
createLabels(labels: CreateLabelInput[], userId: string) {
|
||||
return this.upsert(
|
||||
labels.map((l) => convertToLabel(l, userId)),
|
||||
{
|
||||
conflictPaths: ['name', 'user'],
|
||||
skipUpdateIfNoValuesChanged: true,
|
||||
}
|
||||
)
|
||||
return this.createQueryBuilder()
|
||||
.insert()
|
||||
.into(Label)
|
||||
.values(labels.map((l) => convertToLabel(l, userId)))
|
||||
.orIgnore()
|
||||
.execute()
|
||||
},
|
||||
|
||||
deleteById(id: string) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue