save content reader in the item
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
import express from 'express'
|
||||
import { DeepPartial } from 'typeorm'
|
||||
import { LibraryItem, LibraryItemState } from '../../entity/library_item'
|
||||
import {
|
||||
ContentReaderType,
|
||||
LibraryItem,
|
||||
LibraryItemState,
|
||||
} from '../../entity/library_item'
|
||||
import { UploadFile } from '../../entity/upload_file'
|
||||
import { env } from '../../env'
|
||||
import { PageType, UploadFileStatus } from '../../generated/graphql'
|
||||
@ -160,6 +164,10 @@ export function emailAttachmentRouter() {
|
||||
slug: generateSlug(title),
|
||||
state: LibraryItemState.Succeeded,
|
||||
user: { id: user.id },
|
||||
contentReader:
|
||||
itemType === PageType.File
|
||||
? ContentReaderType.PDF
|
||||
: ContentReaderType.EPUB,
|
||||
}
|
||||
|
||||
const item = await createLibraryItem(itemToCreate, user.id)
|
||||
|
||||
@ -94,6 +94,7 @@ describe('Email attachments Router', () => {
|
||||
const item = await findLibraryItemById(res2.body.id, user.id)
|
||||
|
||||
expect(item).to.exist
|
||||
expect(item?.contentReader).to.eq('PDF')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user