diff --git a/package.json b/package.json index 8ff30db..fecc02a 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "strapi-connector-bookshelf": "3.5.4", "strapi-plugin-content-manager": "3.5.4", "strapi-plugin-content-type-builder": "3.5.4", - "strapi-plugin-documentation": "3.5.4", "strapi-plugin-email": "3.5.4", "strapi-plugin-graphql": "3.5.4", "strapi-plugin-upload": "3.5.4", diff --git a/plugins/mobile/controllers/mobile.js b/plugins/mobile/controllers/mobile.js index 9468163..df88d8f 100644 --- a/plugins/mobile/controllers/mobile.js +++ b/plugins/mobile/controllers/mobile.js @@ -16,36 +16,39 @@ module.exports = { const rawBuilder = strapi.connections.default.raw( "select * from core_store;" ); - const response = await rawBuilder.then(); + let response = await rawBuilder.then(); + if(process.env.NODE_ENV!=="development"){ + response=response.rows; + } const finalInformation = {} - // response.map((e) => - // { - // if(_.startsWith(e.key,"model_def_application::")){ - // const value=JSON.parse(e.value) - // finalInformation[value.uid]={ - // ...finalInformation[value.uid], - // collectionName: value.collectionName, - // kind: value.kind, - // name: value.info.name, - // description: value.info.description, - // } - // } - // if(_.startsWith(e.key, - // "plugin_content_manager_configuration_content_types::application::" - // )){ - // const value=JSON.parse(e.value) - // finalInformation[value.uid]={ - // ...finalInformation[value.uid], - // defaultSortBy: value.settings.defaultSortBy, - // mainField: value.settings.mainField, - // defaultSortOrder: value.settings.defaultSortOrder, - // layout: value.layouts.list - // } - // } - // } - // ); + response.map((e) => + { + if(_.startsWith(e.key,"model_def_application::")){ + const value=JSON.parse(e.value) + finalInformation[value.uid]={ + ...finalInformation[value.uid], + collectionName: value.collectionName, + kind: value.kind, + name: value.info.name, + description: value.info.description, + } + } + if(_.startsWith(e.key, + "plugin_content_manager_configuration_content_types::application::" + )){ + const value=JSON.parse(e.value) + finalInformation[value.uid]={ + ...finalInformation[value.uid], + defaultSortBy: value.settings.defaultSortBy, + mainField: value.settings.mainField, + defaultSortOrder: value.settings.defaultSortOrder, + layout: value.layouts.list + } + } + } + ); ctx.send({ - message: response + message: finalInformation }); }, };