change lodash import to be fp

This commit is contained in:
Marc-Roig 2023-02-28 14:24:50 +01:00
parent 312be981e0
commit 271da71213

View File

@ -6,7 +6,7 @@
/* eslint-disable no-unused-vars */
// Public node modules.
const get = require('lodash/get');
const { get } = require('lodash/fp');
const AWS = require('aws-sdk');
const { getBucketFromUrl } = require('./utils');
@ -22,7 +22,7 @@ module.exports = {
...config,
});
const ACL = get(config, ['params', 'ACL'], 'public-read');
const ACL = get(['params', 'ACL'], config, 'public-read');
const upload = (file, customParams = {}) =>
new Promise((resolve, reject) => {
@ -82,7 +82,7 @@ module.exports = {
{
Bucket: config.params.Bucket,
Key: fileKey,
Expires: get(config, ['params', 'signedUrlExpires'], 60 * 60 * 24 * 7), // 7 days
Expires: get(['params', 'signedUrlExpires'], config, 60 * 60 * 24 * 7), // 7 days
},
(err, url) => {
if (err) {