Special handling of file URLs
This commit is contained in:
@ -109,9 +109,12 @@ export const uploadFileRequestResolver = authorized<
|
||||
input.contentType
|
||||
)
|
||||
|
||||
// If this is a file URL, we swap in a special URL
|
||||
const attachmentUrl = `https://omnivore.app/attachments/${uploadFilePathName}`
|
||||
if (isFileUrl(input.url)) {
|
||||
await authTrx(async (tx) => {
|
||||
await tx.getRepository(UploadFile).update(uploadFileId, {
|
||||
url: attachmentUrl,
|
||||
status: UploadFileStatus.Initialized,
|
||||
})
|
||||
})
|
||||
|
||||
@ -142,7 +142,12 @@ export function emailAttachmentRouter() {
|
||||
return res.status(400).send('BAD REQUEST')
|
||||
}
|
||||
|
||||
const uploadFileUrlOverride = `https://omnivore.app/attachments/${uploadFileId}/${uploadFile.fileName}`
|
||||
const uploadFilePathName = generateUploadFilePathName(
|
||||
uploadFileId,
|
||||
uploadFile.fileName
|
||||
)
|
||||
|
||||
const uploadFileUrlOverride = `https://omnivore.app/attachments/${uploadFilePathName}`
|
||||
const uploadFileHash = uploadFileDetails.md5Hash
|
||||
const itemType =
|
||||
uploadFile.contentType === 'application/pdf'
|
||||
|
||||
Reference in New Issue
Block a user