+
+ /**
+ * called on submit @private onSubmit
+ */
+ public onSubmit(): void {
+ this.isLoad = true;
+ const modalData: MODALCLOSERESPONSEDATA = {
+ message: 'Done'
+ };
+ const id: string = localStorage.getItem('user_id');
+ const payLoad: UNLOCKPARAMS = {};
+ if (this.editType === 'unlock') {
+ payLoad.system_admin_id = id;
+ payLoad.unlock = true;
+ } else {
+ payLoad.system_admin_id = id;
+ payLoad.renew = true;
+ }
+ const apiURLHeader: APIURLHEADER = {
+ url: environment.USERS_URL + '/' + this.id,
+ httpOptions: { headers: this.headers }
+ };
+ this.restService.patchResource(apiURLHeader, payLoad).subscribe((result: {}): void => {
+ this.activeModal.close(modalData);
+ this.isLoad = false;
+ if (this.editType === 'unlock') {
+ this.notifierService.notify('success', this.translateService.instant('PAGE.USERS.UNLOCKUSER'));
+ } else {
+ this.notifierService.notify('success', this.translateService.instant('PAGE.USERS.RENEWUSER'));
+ }
+ }, (error: ERRORDATA): void => {
+ this.restService.handleError(error, 'put');
+ this.isLoad = false;
+ }, (): void => {
+ this.isLoad = false;
+ });
+ }