mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Remove changes to upload.ts
This commit is contained in:
parent
6faa831e15
commit
11f1b78c45
1 changed files with 15 additions and 22 deletions
|
|
@ -20,16 +20,9 @@ export const generateUploadSignedUrl = async (
|
|||
contentType: string,
|
||||
selectedBucket?: string
|
||||
): Promise<string> => {
|
||||
// if (env.dev.isLocal) {
|
||||
// return 'http://localhost:3000/uploads/' + filePathName
|
||||
// }
|
||||
|
||||
console.log(
|
||||
'signed URL',
|
||||
filePathName,
|
||||
contentType,
|
||||
selectedBucket || bucketName
|
||||
)
|
||||
if (env.dev.isLocal) {
|
||||
return 'http://localhost:3000/uploads/' + filePathName
|
||||
}
|
||||
|
||||
// These options will allow temporary uploading of file with requested content type
|
||||
const options: GetSignedUrlConfig = {
|
||||
|
|
@ -66,9 +59,9 @@ export const makeStorageFilePublic = async (
|
|||
id: string,
|
||||
fileName: string
|
||||
): Promise<string> => {
|
||||
// if (env.dev.isLocal) {
|
||||
// return 'http://localhost:3000/public/' + id + '/' + fileName
|
||||
// }
|
||||
if (env.dev.isLocal) {
|
||||
return 'http://localhost:3000/public/' + id + '/' + fileName
|
||||
}
|
||||
|
||||
// Makes the file public
|
||||
const filePathName = generateUploadFilePathName(id, fileName)
|
||||
|
|
@ -82,12 +75,12 @@ export const getStorageFileDetails = async (
|
|||
id: string,
|
||||
fileName: string
|
||||
): Promise<{ md5Hash: string; fileUrl: string }> => {
|
||||
// if (env.dev.isLocal) {
|
||||
// return {
|
||||
// md5Hash: 'some_md5_hash',
|
||||
// fileUrl: 'http://localhost:3000/public/' + id + '/' + fileName,
|
||||
// }
|
||||
// }
|
||||
if (env.dev.isLocal) {
|
||||
return {
|
||||
md5Hash: 'some_md5_hash',
|
||||
fileUrl: 'http://localhost:3000/public/' + id + '/' + fileName,
|
||||
}
|
||||
}
|
||||
|
||||
const filePathName = generateUploadFilePathName(id, fileName)
|
||||
const file = storage.bucket(bucketName).file(filePathName)
|
||||
|
|
@ -110,9 +103,9 @@ export const uploadToSignedUrl = async (
|
|||
data: Buffer,
|
||||
contentType: string
|
||||
): Promise<void> => {
|
||||
// if (env.dev.isLocal) {
|
||||
// return
|
||||
// }
|
||||
if (env.dev.isLocal) {
|
||||
return
|
||||
}
|
||||
|
||||
await axios.put(uploadUrl, data, {
|
||||
headers: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue