strapi-plugin-config-sync/server/utils/index.js

28 lines
511 B
JavaScript
Raw Normal View History

2021-10-14 14:37:00 +02:00
'use strict';
const getCoreStore = () => {
return strapi.store({ type: 'plugin', name: 'config-sync' });
};
const getService = (name) => {
return strapi.plugin('config-sync').service(name);
};
const logMessage = (msg = '') => `[strapi-plugin-config-sync]: ${msg}`;
2021-10-15 14:54:58 +02:00
const sanitizeConfig = (config) => {
delete config._id;
delete config.id;
delete config.updatedAt;
delete config.createdAt;
return config;
};
2021-10-14 14:37:00 +02:00
module.exports = {
getService,
getCoreStore,
logMessage,
2021-10-15 14:54:58 +02:00
sanitizeConfig,
2021-10-14 14:37:00 +02:00
};