fix: example data, media files uniqueness

This commit is contained in:
marcoautiero 2024-09-13 11:21:50 +02:00 committed by Alexandre Bodin
parent 80ca535360
commit 006b5570c8
2 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@ async function checkFileExistsBeforeUpload(files) {
// Check if the file already exists in Strapi
const fileWhereName = await strapi.query('plugin::upload.file').findOne({
where: {
name: fileName,
name: fileName.replace(/\..*$/, ''),
},
});

View File

@ -113,7 +113,7 @@ async function checkFileExistsBeforeUpload(files: string[]): Promise<any> {
// Check if the file already exists in Strapi
const fileWhereName = await strapi.query('plugin::upload.file').findOne({
where: {
name: fileName,
name: fileName.replace(/\..*$/, ''),
},
});