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 0ce16d9 commit 9cc6c8d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 52 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"strapi-plugin-documentation": "3.5.4",
"strapi-plugin-email": "3.5.4",
"strapi-plugin-graphql": "3.5.4",
"strapi-plugin-mobile": "0.0.1",
"strapi-plugin-upload": "3.5.4",
"strapi-plugin-users-permissions": "3.5.4",
"strapi-provider-email-nodemailer": "3.6.0",
Expand Down
8 changes: 0 additions & 8 deletions plugins/mobile/config/routes.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{
"routes": [
{
"method": "GET",
"path": "/",
"handler": "mobile.index",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/metadata",
Expand Down
64 changes: 28 additions & 36 deletions plugins/mobile/controllers/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,38 @@ module.exports = {
*/
tables: async (ctx) => {
const rawBuilder = strapi.connections.default.raw(
"select * from core_store"
"select * from core_store;"
);
const response = await rawBuilder.then();
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
}
}
}
);
ctx.send({
message: finalInformation
});
},
index: async (ctx) => {
// Add your own logic here.
console.error("Heya!");
// Send 200 `ok`
// 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: "mok",
message: response
});
},
};
22 changes: 15 additions & 7 deletions plugins/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,31 @@
"version": "0.0.0",
"description": "This is the description of the plugin.",
"strapi": {
"name": "mobile",
"name": "Mobile Application",
"icon": "plug",
"description": "Description of mobile plugin."
},
"dependencies": {},
"bugs": {
"url": "https://github.com/nirmalhk7/strapi-plugins-mobile/issues",
"email": "nirmalhk7@gmail.com"
},
"author": {
"name": "A Strapi developer",
"email": "",
"url": ""
"name": "Nirmal Khedkar",
"email": "nirmalhk7@gmail.com",
"url": "https://nirmalhk7.tech"
},
"maintainers": [
{
"name": "A Strapi developer",
"email": "",
"url": ""
"name": "Nirmal Khedkar",
"email": "nirmalhk7@gmail.com",
"url": "https://nirmalhk7.tech"
}
],
"repository": {
"type": "git",
"url": "https://github.com/nirmalhk7/strapi-plugins-mobile.git"
},
"engines": {
"node": ">=10.16.0 <=14.x.x",
"npm": ">=6.0.0"
Expand Down

0 comments on commit 9cc6c8d

Please sign in to comment.