tango-app-ui-manage-stores 3.0.28-dev → 3.0.29-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,12 +61,12 @@ class StoresService {
61
61
  createStore(storeBody) {
62
62
  return this.http
63
63
  .post(`${this.storeApiUrl}/create-store`, storeBody)
64
- .pipe(map((response) => response), catchError(this.handleError));
64
+ .pipe(map((response) => response));
65
65
  }
66
66
  updateStore(storeId, storesBodyReq) {
67
67
  return this.http
68
68
  .put(`${this.storeApiUrl}/update-store/${storeId}`, storesBodyReq)
69
- .pipe(map((response) => response), catchError(this.handleError));
69
+ .pipe(map((response) => response));
70
70
  }
71
71
  storeBulkUpload(storesBodyReq) {
72
72
  return this.http
@@ -2242,28 +2242,31 @@ class AddStoresFormComponent {
2242
2242
  });
2243
2243
  }
2244
2244
  }
2245
- this.storesService.createStore(store).subscribe((res) => {
2246
- if (res && res.code === 200 && res.status === "success") {
2247
- this.ts.getSuccessToast("Store Created Successfully!");
2248
- if (res.data.store && res.data.store.storeId) {
2249
- this.storesService
2250
- .createInfraTicket({
2251
- storeId: res.data.store.storeId,
2252
- Date: new Date().toISOString().split("T")[0],
2253
- issueType: "installation",
2254
- })
2255
- .subscribe({
2256
- next: (res) => { },
2257
- error: () => { },
2258
- });
2245
+ this.storesService.createStore(store).subscribe({
2246
+ next: (res) => {
2247
+ if (res && res.code === 200 && res.status === "success") {
2248
+ this.ts.getSuccessToast("Store Created Successfully!");
2249
+ if (res.data.store && res.data.store.storeId) {
2250
+ this.storesService
2251
+ .createInfraTicket({
2252
+ storeId: res.data.store.storeId,
2253
+ Date: new Date().toISOString().split("T")[0],
2254
+ issueType: "installation",
2255
+ })
2256
+ .subscribe({
2257
+ next: (res) => { },
2258
+ error: () => { },
2259
+ });
2260
+ }
2261
+ this.router.navigate(["/manage/stores"]);
2259
2262
  }
2260
- this.router.navigate(["/manage/stores"]);
2261
- }
2262
- else {
2263
- this.ts.getErrorToast("Unable to create store!");
2263
+ else {
2264
+ this.ts.getErrorToast("Unable to create store!");
2265
+ }
2266
+ },
2267
+ error: (error) => {
2268
+ this.ts.getErrorToast(error?.error?.error ? error?.error?.error : "Unable to create Store!");
2264
2269
  }
2265
- }, (error) => {
2266
- this.ts.getErrorToast("Unable to create store!");
2267
2270
  });
2268
2271
  }
2269
2272
  else {