fix: Code order in bootstrap function

pull/38/head
Boaz Poolman 2022-01-13 19:47:00 +01:00
parent 05f037cb64
commit c71531eb5c
1 changed files with 7 additions and 7 deletions

View File

@ -16,13 +16,6 @@ const defaultTypes = require('./config/types');
*/ */
module.exports = async () => { module.exports = async () => {
// Import on bootstrap.
if (strapi.config.get('plugin.config-sync.importOnBootstrap')) {
if (fs.existsSync(strapi.config.get('plugin.config-sync.syncDir'))) {
await strapi.plugin('config-sync').service('main').importAllConfig();
}
}
// Register config types. // Register config types.
const registerTypes = () => { const registerTypes = () => {
const types = {}; const types = {};
@ -43,6 +36,13 @@ module.exports = async () => {
}; };
strapi.plugin('config-sync').types = registerTypes(); strapi.plugin('config-sync').types = registerTypes();
// Import on bootstrap.
if (strapi.config.get('plugin.config-sync.importOnBootstrap')) {
if (fs.existsSync(strapi.config.get('plugin.config-sync.syncDir'))) {
await strapi.plugin('config-sync').service('main').importAllConfig();
}
}
// Register permission actions. // Register permission actions.
const actions = [ const actions = [
{ {