Skip to content

Commit

Permalink
Merge pull request #575 from ever-co/feature/ban-improvements
Browse files Browse the repository at this point in the history
feat(ever-admin): improved ban feature
  • Loading branch information
evereq authored Jun 5, 2019
2 parents d38e9cd + 2670bdb commit 752fdc5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h6 class="warehouse-name-smt">
<strong
>{{ rowData.name
}}<span *ngIf="rowData.isBanned" class="badge badge-danger"
>Banned</span
>ban</span
></strong
>
</h6>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h4 class="modal-title" id="modal-title">Profile Ban</h4>
type="button"
ngbAutofocus
class="btn btn-danger"
(click)="modal.close(user.id)"
(click)="modal.close(user)"
>
Ok
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<button
class="btn btn-danger mr-2 d-inline-block"
[disabled]="!isOnlyOneCustomerSelected"
[disabled]="!isOnlyOneCustomerSelected || showBanLoading"
[nbSpinner]="showBanLoading"
(click)="banSelectedRows()"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ export class CustomersComponent implements AfterViewInit, OnDestroy {
});
modal.componentInstance.user = this._selectedCustomers[0];
modal.result
.then(async (id) => {
.then(async (user) => {
this.showBanLoading = true;
await this._usersService.unbanUser(id);
await this._usersService.unbanUser(user.id);
this._loadDataSmartTable();
this.showBanLoading = false;
this._notifyService.success('User is unbanned.');
this._notifyService.success(`${user.name} is unbanned!`);
})
.catch((_) => {});
}
Expand All @@ -162,12 +162,12 @@ export class CustomersComponent implements AfterViewInit, OnDestroy {
});
modal.componentInstance.user = this._selectedCustomers[0];
modal.result
.then(async (id) => {
.then(async (user) => {
this.showBanLoading = true;
await this._usersService.banUser(id);
await this._usersService.banUser(user.id);
this._loadDataSmartTable();
this.showBanLoading = false;
this._notifyService.success('User is banned');
this._notifyService.success(`${user.name} is banned!`);
})
.catch((_) => {});
}
Expand Down

0 comments on commit 752fdc5

Please sign in to comment.