Skip to content
Snippets Groups Projects
Commit dab463df authored by pgiertych's avatar pgiertych
Browse files

refactored removal methods

parent 821ea54b
Branches
Tags
No related merge requests found
...@@ -46,4 +46,4 @@ ...@@ -46,4 +46,4 @@
</table> </table>
</div> </div>
<app-removal-confirmation-modal [domain]="domainToRemove" (onConfirm)="update()"></app-removal-confirmation-modal> <app-removal-confirmation-modal [domain]="domainToRemove" (onConfirm)="softRemoveDomain(domainToRemove.id)"></app-removal-confirmation-modal>
...@@ -19,21 +19,16 @@ export class RemovalConfirmationModalComponent { ...@@ -19,21 +19,16 @@ export class RemovalConfirmationModalComponent {
@Output() @Output()
public onConfirm: EventEmitter<void> = new EventEmitter<void>(); public onConfirm: EventEmitter<void> = new EventEmitter<void>();
constructor(private readonly domainService: DomainService) { }
public show() { public show() {
this.modal.show(); this.modal.show();
} }
public hide() { public hide() {
this.modal.hide(); this.modal.hide();
this.onConfirm.emit()
} }
removeDomain() { removeDomain() {
this.domainService.remove(this.domain.id, true).subscribe({ this.onConfirm.emit()
next: () => this.hide(), this.hide()
error: err => console.error(err)
});
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment