fix eslint issues

This commit is contained in:
Pierre Noël 2022-08-11 16:59:02 +02:00
parent 654e65c6ae
commit 8668ba9aea
3 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
'use strict';
const createEntityService = require('../');
const createEntityService = require('..');
const entityValidator = require('../../entity-validator');
describe('Entity service triggers webhooks', () => {
@ -12,7 +12,7 @@ describe('Entity service triggers webhooks', () => {
};
let instance;
let eventHub = { emit: jest.fn() };
const eventHub = { emit: jest.fn() };
let entity = { attr: 'value' };
beforeAll(() => {

View File

@ -235,10 +235,10 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
}
const deletedEntities = await db.query(uid).deleteMany(query);
await Promise.all(entitiesToDelete.map(entity => deleteComponents(uid, entity)));
await Promise.all(entitiesToDelete.map((entity) => deleteComponents(uid, entity)));
// Trigger webhooks. One for each entity
await Promise.all(entitiesToDelete.map(entity => this.emitEvent(uid, ENTRY_DELETE, entity)));
await Promise.all(entitiesToDelete.map((entity) => this.emitEvent(uid, ENTRY_DELETE, entity)));
return deletedEntities;
},

View File

@ -198,18 +198,18 @@ module.exports = ({ strapi }) => ({
});
// For performance reasons, all uploads are wrapped in a single Promise.all
const uploadThumbnail = async thumbnailFile => {
const uploadThumbnail = async (thumbnailFile) => {
await getService('provider').upload(thumbnailFile);
_.set(fileData, 'formats.thumbnail', thumbnailFile);
};
const uploadResponsiveFormat = async format => {
const uploadResponsiveFormat = async (format) => {
const { key, file } = format;
await getService('provider').upload(file);
_.set(fileData, ['formats', key], file);
};
let uploadPromises = [];
const uploadPromises = [];
// Upload image
uploadPromises.push(getService('provider').upload(fileData));