optimize settings helper
This commit is contained in:
parent
730c25a9a1
commit
a8edc19f34
11 changed files with 343 additions and 119 deletions
|
@ -7,6 +7,7 @@ import moment from "moment";
|
|||
import InternalException from "../exceptions/internalException";
|
||||
import CalendarFactory from "../factory/admin/club/calendar";
|
||||
import { CalendarHelper } from "../helpers/calendarHelper";
|
||||
import SettingHelper from "../helpers/settingsHelper";
|
||||
|
||||
/**
|
||||
* @description get all calendar items by types or nscdr
|
||||
|
@ -51,3 +52,22 @@ export async function getCalendarItemsByTypes(req: Request, res: Response): Prom
|
|||
res.type("ics").send(value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get configuration of UI
|
||||
* @param req {Request} Express req object
|
||||
* @param res {Response} Express res object
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function getApplicationConfig(req: Request, res: Response): Promise<any> {
|
||||
let config = {
|
||||
"club.name": SettingHelper.getSetting("club.name"),
|
||||
"club.imprint": SettingHelper.getSetting("club.imprint"),
|
||||
"club.privacy": SettingHelper.getSetting("club.privacy"),
|
||||
"club.website": SettingHelper.getSetting("club.website"),
|
||||
"app.custom_login_message": SettingHelper.getSetting("app.custom_login_message"),
|
||||
"app.show_link_to_calendar": SettingHelper.getSetting("app.show_link_to_calendar"),
|
||||
};
|
||||
|
||||
res.json(config);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue