style: Fix eslint warnings
parent
cd8a71f584
commit
15eb3df690
|
@ -19,6 +19,7 @@
|
|||
"test:unit": "jest --verbose"
|
||||
},
|
||||
"dependencies": {
|
||||
"@strapi/strapi": "^4.0.0-beta.12",
|
||||
"chalk": "^4.1.2",
|
||||
"cli-table": "^0.3.6",
|
||||
"commander": "^8.3.0",
|
||||
|
|
|
@ -103,17 +103,17 @@ const handleAction = async (type, skipConfirm) => {
|
|||
const onSuccess = (name) => console.log(`${chalk.green('[success]')} Imported ${name}`);
|
||||
|
||||
try {
|
||||
await app.plugin('config-sync').service('main').importAllConfig(null, onSuccess)
|
||||
await app.plugin('config-sync').service('main').importAllConfig(null, onSuccess);
|
||||
} catch (e) {
|
||||
console.log(`${chalk.red('[error]')} Something went wrong during the import. ${e}`)
|
||||
console.log(`${chalk.red('[error]')} Something went wrong during the import. ${e}`);
|
||||
}
|
||||
}
|
||||
if (type === 'export') {
|
||||
try {
|
||||
await app.plugin('config-sync').service('main').exportAllConfig();
|
||||
console.log(`${chalk.green('[success]')} Exported config`)
|
||||
console.log(`${chalk.green('[success]')} Exported config`);
|
||||
} catch (e) {
|
||||
console.log(`${chalk.red('[error]')} Something went wrong during the export. ${e}`)
|
||||
console.log(`${chalk.red('[error]')} Something went wrong during the export. ${e}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const difference = require('../utils/getObjectDiff');
|
||||
|
||||
/**
|
||||
* Main controllers for config import/export.
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
const { logMessage, sanitizeConfig, dynamicSort } = require('../utils');
|
||||
const difference = require('../utils/getObjectDiff');
|
||||
const arrayDifference = require('../utils/getArrayDiff');
|
||||
|
||||
const difference = require('../utils/getArrayDiff');
|
||||
|
||||
const ConfigType = class ConfigType {
|
||||
constructor(queryString, configPrefix, uid, jsonFields, relations) {
|
||||
|
@ -122,8 +120,8 @@ const ConfigType = class ConfigType {
|
|||
existingConfig = sanitizeConfig(existingConfig, relationName, relationSortField);
|
||||
configContent = sanitizeConfig(configContent, relationName, relationSortField);
|
||||
|
||||
const configToAdd = arrayDifference(configContent[relationName], existingConfig[relationName], relationSortField);
|
||||
const configToDelete = arrayDifference(existingConfig[relationName], configContent[relationName], relationSortField);
|
||||
const configToAdd = difference(configContent[relationName], existingConfig[relationName], relationSortField);
|
||||
const configToDelete = difference(existingConfig[relationName], configContent[relationName], relationSortField);
|
||||
|
||||
await Promise.all(configToDelete.map(async (config) => {
|
||||
await relationQueryApi.delete({
|
||||
|
|
Loading…
Reference in New Issue