fix tests

This commit is contained in:
Hongbo Wu
2024-02-08 10:15:05 +08:00
parent 86f4553dd1
commit c1ba9b8017
3 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,6 @@ import {
OneToMany,
OneToOne,
PrimaryGeneratedColumn,
Unique,
UpdateDateColumn,
} from 'typeorm'
import { Highlight } from './highlight'

View File

@ -1,5 +1,5 @@
import { DeepPartial } from 'typeorm'
import { getColumnsDbName } from '.'
import { getColumns, getColumnsDbName } from '.'
import { appDataSource } from '../data_source'
import { LibraryItem } from '../entity/library_item'
import { keysToCamelCase, wordsCount } from '../utils/helpers'
@ -53,7 +53,7 @@ export const libraryItemRepository = appDataSource
.orUpdate(overwrites, conflictColumns, {
skipUpdateIfNoValuesChanged: true,
})
.returning(columns)
.returning(getColumns(this))
.getQueryAndParameters()
// this is a workaround for the typeorm bug which quotes the md5 function

View File

@ -1034,7 +1034,8 @@ export const deleteLibraryItems = async (
userId?: string
) => {
return authTrx(
async (tx) => tx.withRepository(libraryItemRepository).remove(items),
async (tx) =>
tx.withRepository(libraryItemRepository).delete(items.map((i) => i.id)),
undefined,
userId
)