1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-20 00:25:17 +00:00

Get advanced user info

This commit is contained in:
2020-03-25 18:24:46 +01:00
parent cd0e76d017
commit 4004d5fd77
4 changed files with 13 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import { NewAccount } from "../entities/NewAccount";
import { removeHTMLNodes } from "../utils/StringUtils";
import { limit_query } from "./APILimitsController";
import { Action } from "../helpers/APILimitsHelper";
import { UserController } from "./UserController";
/**
* Account controller
@ -220,10 +221,14 @@ export class AccountController {
public static async ExportData(h: RequestHandler) {
await h.needUserPostPassword("password");
// Query the database
const data = await AccountHelper.Export(h.getUserId());
const out: any = {
userID: data.userID
userID: data.userID,
// General account information
advanced_info: await UserController.UserToAPI(data.userInfo, h, true)
};

View File

@ -68,7 +68,7 @@ export class UserController {
}
private static async UserToAPI(user : User, h: RequestHandler, advanced: boolean = false) : Promise<Object> {
public static async UserToAPI(user : User, h: RequestHandler, advanced: boolean = false) : Promise<Object> {
const info = {
"userID": user.id,
"firstName": user.firstName,