Skip to content

Commit

Permalink
Status Update
Browse files Browse the repository at this point in the history
  • Loading branch information
nirmalhk7 committed May 16, 2021
1 parent 9cc6c8d commit b97eaa3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 29 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
59 changes: 31 additions & 28 deletions plugins/mobile/controllers/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
},
};

0 comments on commit b97eaa3

Please sign in to comment.