forked from PalisadoesFoundation/talawa-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added loadash (PalisadoesFoundation#1345)
- Loading branch information
1 parent
8c64399
commit 0017abe
Showing
6 changed files
with
66 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Plugin } from "../../models"; | ||
import _ from "lodash"; | ||
import pluginData from "./pluginData.json"; | ||
import { logger } from "../../libraries"; | ||
// Only loads plugin data for the time if it's not currently present in the database | ||
const loadPlugins = async (): Promise<void> => { | ||
const res = await Plugin.find(); | ||
let databaseTitle = process.env.MONGO_DB_URL || ""; | ||
databaseTitle = databaseTitle.split("mongodb.net/")[1].split("?")[0]; | ||
if (_.isEmpty(res)) { | ||
pluginData.forEach(async (plugin: any) => { | ||
await Plugin.create(plugin); | ||
}); | ||
logger.info( | ||
"\x1b[1m\x1b[32m%s\x1b[0m", | ||
`Uploaded Plugins in ${databaseTitle} ` | ||
); | ||
} else { | ||
logger.info( | ||
"\x1b[1m\x1b[32m%s\x1b[0m", | ||
`Plugin data already present at ${databaseTitle}` | ||
); | ||
} | ||
}; | ||
|
||
export default loadPlugins; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[ | ||
{ | ||
"pluginInstallStatus": false, | ||
"pluginName": "Posts", | ||
"pluginCreatedBy": "Talawa Team", | ||
"pluginDesc": "Allow users to create, comment and like and share the content in the form of Pictures and Videos.", | ||
"installedOrgs": ["62ccfccd3eb7fd2a30f41601", "62ccfccd3eb7fd2a30f41601"] | ||
}, | ||
{ | ||
"pluginInstallStatus": false, | ||
"pluginName": "Events22222222", | ||
"pluginCreatedBy": "Talawa Team", | ||
"pluginDesc": "Allow users to register and attend for new events with a inbuilt calendar to keep track of daily events.", | ||
"installedOrgs": ["62ccfccd3eb7fd2a30f41601", "62ccfccd3eb7fd2a30f41601"] | ||
}, | ||
{ | ||
"pluginInstallStatus": false, | ||
"pluginName": "Donation", | ||
"pluginCreatedBy": "Talawa Team", | ||
"pluginDesc": "Enables members of the organization to do one time or reccurinng donations to an organization", | ||
"installedOrgs": ["62ccfccd3eb7fd2a30f41601", "62ccfccd3eb7fd2a30f41601"] | ||
}, | ||
{ | ||
"pluginInstallStatus": false, | ||
"pluginName": "Chats", | ||
"pluginCreatedBy": "Talawa Team", | ||
"pluginDesc": "User can share messages with other users in a chat user interface.", | ||
"installedOrgs": ["62ccfccd3eb7fd2a30f41601", "62ccfccd3eb7fd2a30f41601"] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters