fix(S3): load attachement key was wrong
This commit is contained in:
@@ -12,7 +12,7 @@ const s3Client = new S3Client({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const s3Bucket = apiConfig.S3.bucket;
|
const s3Bucket = apiConfig.S3.bucket;
|
||||||
const s3BucketKey = apiConfig.S3.key;
|
const s3BucketKey = apiConfig.S3.load_attachments_key;
|
||||||
|
|
||||||
const Model = require( `${ROOT_PATH}/${MODELS_PATH}/load-attachments.model.js` );
|
const Model = require( `${ROOT_PATH}/${MODELS_PATH}/load-attachments.model.js` );
|
||||||
const UserModel = require( `${ROOT_PATH}/${MODELS_PATH}/users.model.js` );
|
const UserModel = require( `${ROOT_PATH}/${MODELS_PATH}/users.model.js` );
|
||||||
|
|||||||
@@ -68,16 +68,7 @@ async function findElements( companyId , query ){
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function findElementById( elementId , companyId ){
|
async function findElementById( elementId , companyId ){
|
||||||
const filter = {
|
let retVal = await Model.findById( elementId ).populate( populate_list ) || {};
|
||||||
$and : [
|
|
||||||
{ _id : elementId },
|
|
||||||
{ $or :[
|
|
||||||
{ shipper : companyId },
|
|
||||||
{ carrier : companyId }
|
|
||||||
]}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
let retVal = await Model.findOne( filter ).populate( populate_list ) || {};
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user