Files
klz-cables.com/.pnpm-store/v10/files/99/21989175bd4a5518fa9381f4aadde5f04e7d753144e11fd3ad06d7f7382357a385736f0e9d77f458ef2deb4da9886aafded85ee734186169ba0cbec0b4b7f6
Marc Mintel 5397309103
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
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

22 lines
713 B
Plaintext

import fs from 'fs/promises';
import { mapAsync } from '../utilities/mapAsync.js';
/**
* Cleanup temp files after operation lifecycle
*/ export const unlinkTempFiles = async ({ collectionConfig, config, req })=>{
if (config.upload?.useTempFiles && collectionConfig.upload) {
const { file } = req;
const fileArray = [
{
file
}
];
await mapAsync(fileArray, async ({ file })=>{
// Still need this check because this will not be populated if using local API
if (file?.tempFilePath) {
await fs.unlink(file.tempFilePath);
}
});
}
};
//# sourceMappingURL=unlinkTempFiles.js.map