mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fix tests
This commit is contained in:
parent
ccec94dae0
commit
c21ba9e11f
1 changed files with 7 additions and 11 deletions
|
|
@ -73,17 +73,13 @@ export const labelRepository = appDataSource.getRepository(Label).extend({
|
|||
},
|
||||
|
||||
createLabels(labels: CreateLabelInput[], userId: string) {
|
||||
return this.query(
|
||||
`
|
||||
INSERT INTO omnivore.labels (user_id, name, color, description, internal)
|
||||
SELECT $1, $2, $3, $4, $5
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM omnivore.labels WHERE LOWER(name) = LOWER($2) AND user_id = $1
|
||||
)
|
||||
RETURNING id, name, color, description, created_at
|
||||
`,
|
||||
labels.map((l) => Object.values(convertToLabel(l, userId)))
|
||||
) as Promise<Label[]>
|
||||
return this.upsert(
|
||||
labels.map((l) => convertToLabel(l, userId)),
|
||||
{
|
||||
conflictPaths: ['name', 'user'],
|
||||
skipUpdateIfNoValuesChanged: true,
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
deleteById(id: string) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue