| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2020 TATA ELXSI |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in) |
| 17 | */ |
| 18 | /** |
| 19 | * @file Delete Model |
| 20 | */ |
| 21 | import { HttpHeaders } from '@angular/common/http'; |
| 22 | import { Component, Injector, Input } from '@angular/core'; |
| 23 | import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; |
| 24 | import { TranslateService } from '@ngx-translate/core'; |
| 25 | import { NotifierService } from 'angular-notifier'; |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 26 | import { APIURLHEADER, DELETEPARAMS, ERRORDATA, MODALCLOSERESPONSEDATA, URLPARAMS } from 'CommonModel'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 27 | import { DataService } from 'DataService'; |
| 28 | import { environment } from 'environment'; |
| 29 | import { RestService } from 'RestService'; |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 30 | import { isNullOrUndefined } from 'SharedService'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Creating component |
| 34 | * @Component takes DeleteComponent.html as template url |
| 35 | */ |
| 36 | @Component({ |
| 37 | selector: 'app-delete', |
| 38 | templateUrl: './DeleteComponent.html', |
| 39 | styleUrls: ['./DeleteComponent.scss'] |
| 40 | }) |
| 41 | /** Exporting a class @exports DeleteComponent */ |
| 42 | export class DeleteComponent { |
| 43 | /** To inject services @public */ |
| 44 | public injector: Injector; |
| 45 | |
| 46 | /** Instance for active modal service @public */ |
| 47 | public activeModal: NgbActiveModal; |
| 48 | |
| 49 | /** Instance of the modal service @public */ |
| 50 | public title: string; |
| 51 | |
| 52 | /** Show the Delete Ok button to trigger the terminate and delete */ |
| 53 | public forceDelete: boolean = false; |
| 54 | |
| 55 | /** Check the loading results @public */ |
| 56 | public isLoadingResults: Boolean = false; |
| 57 | |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 58 | /** Check the page @public */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 59 | public isPage = false; |
| 60 | |
| 61 | /** Check the register page @public */ |
| 62 | public isRegisterPage = false; |
| 63 | |
| 64 | /** contain page @public */ |
| 65 | public page: string; |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 66 | |
| 67 | /** Number of instances @public */ |
| 68 | // eslint-disable-next-line @typescript-eslint/no-magic-numbers |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 69 | public noOfInstances: number = 10; |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 70 | |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 71 | /** Give the message for the loading @public */ |
| 72 | public notifyMessage: string = 'DELETELOADERMESSAGE'; |
| 73 | |
| 74 | /** Give the message for the loading @public */ |
| 75 | public message: string = 'PLEASEWAIT'; |
| 76 | |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 77 | /** Check whether cluster is credated or registered @public */ |
| 78 | public createdbyosm: string; |
| 79 | |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 80 | /** DataService to pass the data from one component to another @private */ |
| 81 | private dataService: DataService; |
| 82 | |
| 83 | /** Instance of the rest service @private */ |
| 84 | private restService: RestService; |
| 85 | |
| 86 | /** Instance of the modal service @private */ |
| 87 | private id: string; |
| 88 | |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 89 | /** contsians bootstrap value @private */ |
| 90 | private bootstrap: boolean; |
| 91 | |
| 92 | /** Check whether cluster is registered or not @private */ |
| 93 | private key: boolean; |
| 94 | |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 95 | /** Variables holds url to be delete @private */ |
| 96 | private deleteURL: string; |
| 97 | |
| 98 | /** Controls the header form @private */ |
| 99 | private headers: HttpHeaders; |
| 100 | |
| 101 | /** Input contains component objects @private */ |
| 102 | @Input() private params: URLPARAMS; |
| 103 | |
| 104 | /** Notifier service to popup notification @private */ |
| 105 | private notifierService: NotifierService; |
| 106 | |
| 107 | /** Contains tranlsate instance @private */ |
| 108 | private translateService: TranslateService; |
| 109 | |
| 110 | constructor(injector: Injector) { |
| 111 | this.injector = injector; |
| 112 | this.restService = this.injector.get(RestService); |
| 113 | this.dataService = this.injector.get(DataService); |
| 114 | this.activeModal = this.injector.get(NgbActiveModal); |
| 115 | this.notifierService = this.injector.get(NotifierService); |
| 116 | this.translateService = this.injector.get(TranslateService); |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Lifecyle Hooks the trigger before component is instantiate |
| 121 | */ |
| 122 | public ngOnInit(): void { |
| 123 | this.headers = new HttpHeaders({ |
| 124 | 'Content-Type': 'application/json', |
| 125 | Accept: 'application/json', |
| 126 | 'Cache-Control': 'no-cache, no-store, must-revalidate, max-age=0' |
| 127 | }); |
| 128 | this.dataService.currentMessage.subscribe((data: DELETEPARAMS) => { |
| 129 | if (data.identifier !== undefined || data.identifier !== '' || data.identifier !== null) { |
| 130 | this.id = data.identifier; |
| 131 | } |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 132 | if (sessionStorage.getItem('clusterType') === 'Registered') { |
| 133 | this.isRegisterPage = true; |
| 134 | } |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 135 | if (data.createdbyosm === 'NO' || data.createdbyosm === 'false') { |
| 136 | this.createdbyosm = 'false'; |
| 137 | } else { |
| 138 | this.createdbyosm = 'true'; |
| 139 | } |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 140 | this.bootstrap = data.bootstrap; |
| 141 | this.key = data.key; |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 142 | if (!isNullOrUndefined(this.params)) { |
| 143 | if (this.params.page === 'instantiateNS') { |
| 144 | this.isPage = true; |
| 145 | this.title = ''; |
| 146 | this.createDeleteUrl(data); |
| 147 | } else if (this.params.page === 'ns-instance') { |
| 148 | this.createDeleteUrl(data); |
| 149 | this.isPage = false; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 150 | } else { |
| 151 | this.createTitleandID(data); |
| 152 | this.createDeleteUrl(data); |
| 153 | this.isPage = false; |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 154 | } |
| 155 | } else { |
| 156 | this.createTitleandID(data); |
| 157 | this.createDeleteUrl(data); |
| 158 | this.isPage = false; |
| 159 | } |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 160 | }); |
| 161 | } |
| 162 | /** Generate Title and Id from data @public */ |
| 163 | public createTitleandID(data: DELETEPARAMS): void { |
| 164 | this.title = ''; |
| 165 | if (data.name !== undefined) { |
| 166 | this.title = data.name; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 167 | } else if (data.projectName !== undefined) { |
| 168 | this.title = data.projectName; |
| 169 | this.id = this.title; |
| 170 | } else if (data.userName !== undefined) { |
| 171 | this.title = data.userName; |
| 172 | } else if (data.username !== undefined) { |
| 173 | this.title = data.username; |
| Barath Kumar R | 063a3f1 | 2020-12-29 16:35:09 +0530 | [diff] [blame] | 174 | } else if (data.productName !== undefined) { |
| 175 | this.title = data.productName; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 176 | } |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 177 | if (data.createdbyosm === 'NO' || data.createdbyosm === 'false') { |
| 178 | this.createdbyosm = 'false'; |
| 179 | } else { |
| 180 | this.createdbyosm = 'true'; |
| 181 | } |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 182 | } |
| 183 | /** Generate Delete url from data @public */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 184 | // eslint-disable-next-line complexity |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 185 | public createDeleteUrl(data: DELETEPARAMS): void { |
| 186 | this.deleteURL = ''; |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 187 | if (!isNullOrUndefined(this.params)) { |
| 188 | if (this.params.page === 'ns-instance') { |
| 189 | this.deleteURL = environment.NSINSTANCESCONTENT_URL; |
| 190 | this.forceDelete = this.params.forceDeleteType; |
| 191 | this.title = this.params.name; |
| 192 | this.id = this.params.id; |
| 193 | } else if (this.params.page === 'instantiateNS') { |
| 194 | this.deleteURL = environment.NSINSTANCESTERMINATE_URL; |
| 195 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 196 | } else if (this.params.page === 'card-node') { |
| 197 | this.title = this.params.name; |
| 198 | } else if (this.params.page === 'card-ksu') { |
| 199 | this.title = this.params.name; |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 200 | } |
| 201 | } |
| 202 | if (data.page === 'ns-package') { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 203 | this.deleteURL = environment.NSDESCRIPTORSCONTENT_URL; |
| 204 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| 205 | } else if (data.page === 'vnf-package') { |
| 206 | this.deleteURL = environment.VNFPACKAGESCONTENT_URL; |
| 207 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| 208 | } else if (data.page === 'vim-account') { |
| 209 | this.deleteURL = environment.VIMACCOUNTS_URL; |
| 210 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| 211 | } else if (data.page === 'wim-account') { |
| 212 | this.deleteURL = environment.WIMACCOUNTS_URL; |
| 213 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| 214 | } else if (data.page === 'projects') { |
| 215 | this.deleteURL = environment.PROJECTS_URL; |
| 216 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| 217 | this.id = data.id; |
| 218 | } else if (data.page === 'users') { |
| 219 | this.deleteURL = environment.USERS_URL; |
| 220 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| 221 | } else if (data.page === 'network-slice') { |
| 222 | this.deleteURL = environment.NETWORKSLICETEMPLATECONTENT_URL; |
| 223 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| 224 | } else if (data.page === 'net-slice-instance') { |
| 225 | this.deleteURL = environment.NETWORKSLICEINSTANCESCONTENT_URL; |
| 226 | this.forceDelete = this.params.forceDeleteType; |
| 227 | } else if (data.page === 'roles') { |
| 228 | this.deleteURL = environment.ROLES_URL; |
| 229 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| 230 | } else if (data.page === 'pdu-instances') { |
| 231 | this.deleteURL = environment.PDUINSTANCE_URL; |
| 232 | } else if (data.page === 'sdn-controller') { |
| 233 | this.deleteURL = environment.SDNCONTROLLER_URL; |
| 234 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 235 | } else if (data.page === 'k8-repo') { |
| 236 | this.deleteURL = environment.K8REPOS_URL; |
| 237 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| Barath Kumar R | 403234e | 2020-07-07 15:48:58 +0530 | [diff] [blame] | 238 | } else if (data.page === 'osmrepo') { |
| 239 | this.deleteURL = environment.OSMREPOS_URL; |
| 240 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| SANDHYA.JS | 07decc0 | 2024-07-01 21:50:48 +0530 | [diff] [blame] | 241 | } else if (data.page === 'ns-config-template') { |
| 242 | this.deleteURL = environment.NSCONFIGTEMPLATE_URL; |
| 243 | this.notifyMessage = 'DELETEDSUCCESSFULLY'; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 244 | } else if (data.page === 'k8-infra-profile') { |
| SANDHYA.JS | 52af480 | 2025-05-22 17:00:15 +0530 | [diff] [blame] | 245 | this.forceDelete = this.params.forceDeleteType; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 246 | this.deleteURL = environment.K8SINFRACONFIGPROFILE_URL; |
| 247 | } else if (data.page === 'k8-infra-controller') { |
| SANDHYA.JS | 52af480 | 2025-05-22 17:00:15 +0530 | [diff] [blame] | 248 | this.forceDelete = this.params.forceDeleteType; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 249 | this.deleteURL = environment.K8SINFRACONTROLLERPROFILE_URL; |
| 250 | } else if (data.page === 'k8-app-profile') { |
| SANDHYA.JS | 52af480 | 2025-05-22 17:00:15 +0530 | [diff] [blame] | 251 | this.forceDelete = this.params.forceDeleteType; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 252 | this.deleteURL = environment.K8SAPPPROFILE_URL; |
| 253 | } else if (data.page === 'k8-resource-profile') { |
| SANDHYA.JS | 52af480 | 2025-05-22 17:00:15 +0530 | [diff] [blame] | 254 | this.forceDelete = this.params.forceDeleteType; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 255 | this.deleteURL = environment.K8SRESOURCEPROFILE_URL; |
| 256 | } else if (data.page === 'oka-packages') { |
| SANDHYA.JS | 52af480 | 2025-05-22 17:00:15 +0530 | [diff] [blame] | 257 | this.forceDelete = this.params.forceDeleteType; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 258 | this.deleteURL = environment.OKAPACKAGES_URL; |
| 259 | } else if (data.page === 'k8-ksu') { |
| SANDHYA.JS | 52af480 | 2025-05-22 17:00:15 +0530 | [diff] [blame] | 260 | this.forceDelete = this.params.forceDeleteType; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 261 | this.deleteURL = environment.KSU_URL; |
| 262 | } else if (data.page === 'k8-cluster') { |
| SANDHYA.JS | 52af480 | 2025-05-22 17:00:15 +0530 | [diff] [blame] | 263 | this.forceDelete = this.params.forceDeleteType; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 264 | this.page = data.page; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 265 | } else if (data.page === 'k8s-node') { |
| 266 | this.deleteURL = environment.K8SCREATECLUSTER_URL + '/' + data.cluster_id + '/node'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 267 | } |
| 268 | } |
| 269 | /** Generate Data function @public */ |
| 270 | public deleteData(): void { |
| 271 | this.isLoadingResults = true; |
| 272 | const modalData: MODALCLOSERESPONSEDATA = { |
| 273 | message: 'Done' |
| 274 | }; |
| 275 | let deletingURl: string = ''; |
| 276 | if (this.forceDelete) { |
| SANDHYA.JS | 52af480 | 2025-05-22 17:00:15 +0530 | [diff] [blame] | 277 | if (this.page === 'k8-cluster') { |
| 278 | if (this.createdbyosm === 'true') { |
| 279 | this.deleteURL = environment.K8SCREATECLUSTER_URL; |
| 280 | } |
| 281 | } |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 282 | deletingURl = this.deleteURL + '/' + this.id + '?FORCE=true'; |
| SANDHYA.JS | 93fe824 | 2025-09-24 14:52:25 +0530 | [diff] [blame^] | 283 | this.notifyMessage = 'DELETELOADMESSAGE'; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 284 | } else if (this.page === 'k8-cluster') { |
| 285 | if (this.createdbyosm === 'true') { |
| 286 | this.deleteURL = environment.K8SCREATECLUSTER_URL; |
| 287 | deletingURl = this.deleteURL + '/' + this.id; |
| 288 | } else { |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 289 | if (this.key === false) { |
| 290 | this.deleteURL = environment.K8SCREATECLUSTER_URL; |
| 291 | deletingURl = this.deleteURL + '/' + this.id + '/deregister'; |
| 292 | } else if (this.key === true) { |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 293 | this.deleteURL = environment.K8SCLUSTER_URL; |
| 294 | deletingURl = this.deleteURL + '/' + this.id; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 295 | } |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 296 | } |
| SANDHYA.JS | 93fe824 | 2025-09-24 14:52:25 +0530 | [diff] [blame^] | 297 | } else if (this.params.page === 'card-node' || this.params.page === 'card-ksu') { |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 298 | if (this.params.page === 'card-node') { |
| 299 | this.createdbyosm = 'true'; |
| 300 | deletingURl = environment.K8SCREATECLUSTER_URL + '/' + this.params.cluster_id + '/nodegroup' + '/' + this.params.id; |
| 301 | } else if (this.params.page === 'card-ksu') { |
| 302 | deletingURl = environment.KSU_URL + '/' + this.params.id; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 303 | } |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 304 | } else { |
| 305 | deletingURl = this.deleteURL + '/' + this.id; |
| 306 | } |
| 307 | this.restService.deleteResource(deletingURl).subscribe((res: {}) => { |
| 308 | this.activeModal.close(modalData); |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 309 | this.notifierService.notify('success', this.translateService.instant(this.notifyMessage, { title: this.title })); |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 310 | }, (error: ERRORDATA) => { |
| 311 | this.isLoadingResults = false; |
| 312 | this.restService.handleError(error, 'delete'); |
| 313 | }, () => { |
| 314 | this.isLoadingResults = false; |
| 315 | }); |
| 316 | } |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 317 | |
| 318 | /** terminate multiple ns instances function @public */ |
| 319 | public terminate(): void { |
| 320 | this.isLoadingResults = true; |
| 321 | const modalData: MODALCLOSERESPONSEDATA = { |
| 322 | message: 'Done' |
| 323 | }; |
| 324 | const idData: string[] = []; |
| 325 | this.params.identifierList.forEach((data: DELETEPARAMS) => { |
| 326 | idData.push(data.identifier); |
| 327 | }); |
| 328 | if (idData.length > this.noOfInstances) { |
| 329 | this.activeModal.close(modalData); |
| 330 | this.notifierService.notify('warning', this.translateService.instant('WARNINGMESSAGE')); |
| 331 | } else { |
| 332 | const postData: {} = { |
| 333 | ns_ids: idData |
| 334 | }; |
| 335 | let deletingURl: string = ''; |
| 336 | deletingURl = this.deleteURL; |
| 337 | this.notifyMessage = 'DELETELOADMESSAGE'; |
| 338 | const apiURLHeader: APIURLHEADER = { |
| 339 | url: deletingURl, |
| 340 | httpOptions: { headers: this.headers } |
| 341 | }; |
| 342 | this.restService.postResource(apiURLHeader, postData).subscribe(() => { |
| 343 | this.activeModal.close(modalData); |
| 344 | this.isLoadingResults = false; |
| 345 | this.notifierService.notify('success', this.translateService.instant(this.notifyMessage)); |
| 346 | }, (error: ERRORDATA) => { |
| 347 | this.isLoadingResults = false; |
| 348 | this.restService.handleError(error, 'post'); |
| 349 | }, () => { |
| 350 | this.isLoadingResults = false; |
| 351 | }); |
| 352 | } |
| 353 | } |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 354 | } |