Add app settings model, routes, db ops, service, use settings for issueToken
This commit is contained in:
1 parent
b2bc441c7f
commit
992bf099fa
12 files changed
+210
-19
No files matched your search
@@ -0,0 +1,17 @@
|
||||
const AppSettings = require("../../../models/AppSettings");
|
||||
const SERVICE_NAME = "SettingsModule";
|
||||
|
||||
const getAppSettings = async () => {
|
||||
try {
|
||||
const settings = AppSettings.findOne();
|
||||
return settings;
|
||||
} catch (error) {
|
||||
error.service = SERVICE_NAME;
|
||||
error.method = "getSettings";
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getAppSettings,
|
||||
};
|
||||
@@ -35,6 +35,7 @@ const insertUser = async (userData, imageFile) => {
|
||||
email: userData.email,
|
||||
});
|
||||
userData.teamId = team._id;
|
||||
userData.checkTTL = 60 * 60 * 24 * 30;
|
||||
await team.save();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user