mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 13:29:22 +00:00
Can get language settings
This commit is contained in:
parent
373eb6b4b0
commit
2842fdc55f
@ -87,6 +87,8 @@ export const Routes : Route[] = [
|
|||||||
|
|
||||||
{path: "/settings/check_user_directory_availability", cb: (h) => SettingsController.CheckDirectoryAvailability(h)},
|
{path: "/settings/check_user_directory_availability", cb: (h) => SettingsController.CheckDirectoryAvailability(h)},
|
||||||
|
|
||||||
|
{path: "/settings/get_language", cb: (h) => SettingsController.GetLanguage(h)},
|
||||||
|
|
||||||
|
|
||||||
// Friends controller
|
// Friends controller
|
||||||
{path: "/friends/getList", cb: (h) => FriendsController.GetList(h)},
|
{path: "/friends/getList", cb: (h) => FriendsController.GetList(h)},
|
||||||
|
@ -103,4 +103,19 @@ export class SettingsController {
|
|||||||
h.success("The directory is available!");
|
h.success("The directory is available!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get language settings
|
||||||
|
*
|
||||||
|
* @param h Request handler
|
||||||
|
*/
|
||||||
|
public static async GetLanguage(h: RequestHandler) {
|
||||||
|
|
||||||
|
const userInfo = await UserHelper.GetUserInfo(h.getUserId());
|
||||||
|
|
||||||
|
h.send({
|
||||||
|
lang: userInfo.lang
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -44,6 +44,11 @@ export interface GeneralSettings {
|
|||||||
publicNote ?: string
|
publicNote ?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface LangSettings {
|
||||||
|
id: number,
|
||||||
|
lang: string,
|
||||||
|
}
|
||||||
|
|
||||||
export interface SecuritySettings {
|
export interface SecuritySettings {
|
||||||
id: number,
|
id: number,
|
||||||
security_question_1 ?: string,
|
security_question_1 ?: string,
|
||||||
@ -53,7 +58,7 @@ export interface SecuritySettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface UserBuilder extends UserInfo, SecuritySettings, GeneralSettings {
|
export interface UserBuilder extends UserInfo, SecuritySettings, LangSettings, GeneralSettings {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,6 +77,7 @@ export class User implements UserBuilder {
|
|||||||
blockComments: boolean;
|
blockComments: boolean;
|
||||||
allowPostsFromFriends: boolean;
|
allowPostsFromFriends: boolean;
|
||||||
allowMails: boolean;
|
allowMails: boolean;
|
||||||
|
lang: string;
|
||||||
security_question_1?: string;
|
security_question_1?: string;
|
||||||
security_answer_1?: string;
|
security_answer_1?: string;
|
||||||
security_question_2?: string;
|
security_question_2?: string;
|
||||||
|
@ -206,6 +206,7 @@ export class UserHelper {
|
|||||||
blockComments: row.bloquecommentaire == 1,
|
blockComments: row.bloquecommentaire == 1,
|
||||||
allowPostsFromFriends: row.autoriser_post_amis == 1,
|
allowPostsFromFriends: row.autoriser_post_amis == 1,
|
||||||
allowMails: row.autorise_mail == 1,
|
allowMails: row.autorise_mail == 1,
|
||||||
|
lang: row.lang,
|
||||||
security_question_1: row.question1,
|
security_question_1: row.question1,
|
||||||
security_answer_1: row.reponse1,
|
security_answer_1: row.reponse1,
|
||||||
security_question_2: row.question2,
|
security_question_2: row.question2,
|
||||||
|
Loading…
Reference in New Issue
Block a user