fix email attachment not being saved as item
This commit is contained in:
@ -150,7 +150,7 @@ export function emailAttachmentRouter() {
|
||||
? PageType.File
|
||||
: PageType.Book
|
||||
const title = subject || uploadFileData.fileName
|
||||
const articleToSave: DeepPartial<LibraryItem> = {
|
||||
const itemToCreate: DeepPartial<LibraryItem> = {
|
||||
originalUrl: uploadFileUrlOverride,
|
||||
itemType,
|
||||
textContentHash: uploadFileHash,
|
||||
@ -159,9 +159,10 @@ export function emailAttachmentRouter() {
|
||||
readableContent: '',
|
||||
slug: generateSlug(title),
|
||||
state: LibraryItemState.Succeeded,
|
||||
user: { id: user.id },
|
||||
}
|
||||
|
||||
const pageId = await createLibraryItem(articleToSave, user.id)
|
||||
const pageId = await createLibraryItem(itemToCreate, user.id)
|
||||
|
||||
// update received email type
|
||||
await updateReceivedEmail(receivedEmailId, 'article', user.id)
|
||||
|
||||
Reference in New Issue
Block a user