mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-27 15:59:22 +00:00
39 lines
988 B
TypeScript
39 lines
988 B
TypeScript
|
/**
|
||
|
* Settings controller
|
||
|
*
|
||
|
* @author Pierre HUBERT
|
||
|
*/
|
||
|
|
||
|
import { RequestHandler } from "../entities/RequestHandler";
|
||
|
import { UserHelper } from "../helpers/UserHelper";
|
||
|
import { UserController } from "./UserController";
|
||
|
|
||
|
export class SettingsController {
|
||
|
|
||
|
/**
|
||
|
* Get general account settings
|
||
|
*
|
||
|
* @param h Request handler
|
||
|
*/
|
||
|
public static async GetGeneral(h: RequestHandler) {
|
||
|
|
||
|
const userInfo = await UserHelper.GetUserInfo(h.getUserId());
|
||
|
|
||
|
h.send({
|
||
|
id: userInfo.id,
|
||
|
email: userInfo.email,
|
||
|
firstName: userInfo.firstName,
|
||
|
lastName: userInfo.lastName,
|
||
|
is_public: userInfo.isPublic,
|
||
|
is_open: userInfo.isOpen,
|
||
|
allow_comments: !userInfo.blockComments,
|
||
|
allow_posts_from_friends: userInfo.allowPostsFromFriends,
|
||
|
allow_comunic_mails: userInfo.allowMails,
|
||
|
public_friends_list: userInfo.friendsListPublic,
|
||
|
virtual_directory: userInfo.virtualDirectory,
|
||
|
personnal_website: userInfo.personnalWebsite,
|
||
|
publicNote: userInfo.publicNote,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
}
|