mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fix: showing original url instead of signed url for pdf files in search api response
This commit is contained in:
parent
4b3374f400
commit
3c75a23e75
3 changed files with 5 additions and 2 deletions
|
|
@ -129,6 +129,10 @@ export class LibraryItem {
|
|||
@JoinColumn({ name: 'upload_file_id' })
|
||||
uploadFile?: UploadFile
|
||||
|
||||
// get upload_file_id without loading the uploadFile entity
|
||||
@Column('text', { nullable: true })
|
||||
uploadFileId?: string
|
||||
|
||||
@Column('enum', { enum: ContentReaderType, default: ContentReaderType.WEB })
|
||||
contentReader!: ContentReaderType
|
||||
|
||||
|
|
|
|||
|
|
@ -465,7 +465,7 @@ export const functionResolvers = {
|
|||
async url(item: SearchItem, _: unknown, ctx: WithDataSourcesContext) {
|
||||
if (
|
||||
(item.pageType == PageType.File || item.pageType == PageType.Book) &&
|
||||
ctx.uid &&
|
||||
ctx.claims &&
|
||||
item.uploadFileId
|
||||
) {
|
||||
const upload = await findUploadFileById(item.uploadFileId)
|
||||
|
|
|
|||
|
|
@ -268,7 +268,6 @@ export const libraryItemToSearchItem = (item: LibraryItem): SearchItem => ({
|
|||
),
|
||||
image: item.thumbnail,
|
||||
highlights: item.highlights?.map(highlightDataToHighlight),
|
||||
uploadFileId: item.uploadFile?.id,
|
||||
wordsCount: item.wordCount,
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue