if (this.osmrepoForm.invalid) {
return;
}
- this.isLoadingResults = true;
const modalData: MODALCLOSERESPONSEDATA = {
message: 'Done'
};
/** This function used to add the osm repo @public */
public addOsmRepo(apiURLHeader: APIURLHEADER, modalData: MODALCLOSERESPONSEDATA): void {
+ this.isLoadingResults = true;
this.restService.postResource(apiURLHeader, this.osmrepoForm.value).subscribe(() => {
+ this.isLoadingResults = false;
this.activeModal.close(modalData);
this.notifierService.notify('success', this.translateService.instant('PAGE.OSMREPO.CREATEDSUCCESSFULLY'));
- this.isLoadingResults = false;
}, (error: ERRORDATA) => {
this.isLoadingResults = false;
this.restService.handleError(error, 'post');
/** This function used to Edit the osm repo @public */
public editOsmRepo(apiURLHeader: APIURLHEADER, modalData: MODALCLOSERESPONSEDATA): void {
+ if (!this.osmrepoForm.dirty) {
+ this.notifierService.notify('warning', this.translateService.instant('PAGE.TOPOLOGY.DATAEMPTY'));
+ return;
+ }
+ this.isLoadingResults = true;
this.restService.patchResource(apiURLHeader, this.osmrepoForm.value).subscribe(() => {
- this.activeModal.close(modalData);
- this.notifierService.notify('success', this.translateService.instant('PAGE.OSMREPO.UPDATEDSUCCESSFULLY'));
this.isLoadingResults = false;
+ this.notifierService.notify('success', this.translateService.instant('PAGE.OSMREPO.UPDATEDSUCCESSFULLY'));
+ this.activeModal.close(modalData);
}, (error: ERRORDATA) => {
this.isLoadingResults = false;
this.restService.handleError(error, 'patch');