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:
@ -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)
|
||||
};
|
||||
|
||||
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user