Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
14 lines
453 B
Plaintext
14 lines
453 B
Plaintext
import { FileUploadError } from '../errors/index.js';
|
|
import { saveBufferToFile } from './saveBufferToFile.js';
|
|
export const uploadFiles = async (payload, files, req)=>{
|
|
try {
|
|
await Promise.all(files.map(async ({ buffer, path })=>{
|
|
await saveBufferToFile(buffer, path);
|
|
}));
|
|
} catch (err) {
|
|
payload.logger.error(err);
|
|
throw new FileUploadError(req.t);
|
|
}
|
|
};
|
|
|
|
//# sourceMappingURL=uploadFiles.js.map |