fix tests

This commit is contained in:
Hongbo Wu 2024-05-13 19:13:55 +08:00
parent 33e1c4dd00
commit 302efc119e
2 changed files with 2 additions and 2 deletions

View file

@ -67,7 +67,7 @@ export const uploadContentJob = async (data: UploadContentJobData) => {
const { column, highlights } = getSelectOptions(format)
const libraryItem = await findLibraryItemById(libraryItemId, userId, {
select: [column],
select: ['id', column], // id is required for relations
relations: {
highlights,
},

View file

@ -807,7 +807,7 @@ export const findLibraryItemById = async (
return authTrx(
async (tx) =>
tx.withRepository(libraryItemRepository).findOne({
select: ['id' as keyof LibraryItem].concat(options?.select || []), // always select id
select: options?.select,
where: { id },
relations: options?.relations,
}),