Skip to content

Commit

Permalink
feat(mon-pix): call /my-account endpoint on MyAccount page
Browse files Browse the repository at this point in the history
  • Loading branch information
bpetetot authored Nov 20, 2024
1 parent 9c10594 commit 1fb4563
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mon-pix/app/models/account-info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Model, { attr } from '@ember-data/model';

export default class AccountInfo extends Model {
@attr('string') email;
@attr('string') username;
@attr('boolean') canSelfDeleteAccount;
}
1 change: 1 addition & 0 deletions mon-pix/app/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default class User extends Model {
// includes
@belongsTo('is-certifiable', { async: true, inverse: null }) isCertifiable;
@belongsTo('profile', { async: true, inverse: null }) profile;
@belongsTo('account-info', { async: true, inverse: null }) accountInfo;
@hasMany('certification', { async: true, inverse: 'user' }) certifications;
@hasMany('scorecard', { async: true, inverse: null }) scorecards;
@hasMany('training', { async: true, inverse: null }) trainings;
Expand Down
5 changes: 5 additions & 0 deletions mon-pix/app/templates/authenticated/user-account.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
</LinkTo>
</li>
{{/if}}
{{#if @model.accountInfo.canSelfDeleteAccount}}
<li>
{{! ADD DELETE ACCOUNT LINK HERE }}
</li>
{{/if}}
</ul>
</nav>
</PixBlock>
Expand Down

0 comments on commit 1fb4563

Please sign in to comment.