AccountController: serialize user personal info fields
This commit is contained in:
parent
d925237233
commit
64cec2987d
@ -58,6 +58,7 @@ export default class AccountController extends Controller {
|
|||||||
const nameChangeRemainingTime = new Date(nameChangedAt + nameChangeWaitPeriod);
|
const nameChangeRemainingTime = new Date(nameChangedAt + nameChangeWaitPeriod);
|
||||||
|
|
||||||
res.render('auth/account/account', {
|
res.render('auth/account/account', {
|
||||||
|
user_personal_info_fields: user.getPersonalInfoFields(),
|
||||||
main_email: await user.mainEmail.get(),
|
main_email: await user.mainEmail.get(),
|
||||||
emails: await user.emails.get(),
|
emails: await user.emails.get(),
|
||||||
display_email_warning: config.get('app.display_email_warning'),
|
display_email_warning: config.get('app.display_email_warning'),
|
||||||
|
@ -43,7 +43,7 @@ export default class User extends Model {
|
|||||||
return !User.isApprovalMode() || this.as(UserApprovedComponent).approved;
|
return !User.isApprovalMode() || this.as(UserApprovedComponent).approved;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getPersonalInfoFields(): { name: string, value: string }[] {
|
public getPersonalInfoFields(): { name: string, value: string }[] {
|
||||||
const fields: { name: string, value: string }[] = [];
|
const fields: { name: string, value: string }[] = [];
|
||||||
const nameComponent = this.asOptional(UserNameComponent);
|
const nameComponent = this.asOptional(UserNameComponent);
|
||||||
if (nameComponent && nameComponent.hasName()) {
|
if (nameComponent && nameComponent.hasName()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user