tango-app-ui-manage-stores 3.0.28-dev → 3.0.30-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,17 +61,17 @@ 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
73
73
  .post(`${this.storeApiUrl}/storeBulkUpload`, storesBodyReq)
74
- .pipe(map((response) => response), catchError(this.handleError));
74
+ .pipe(map((response) => response));
75
75
  }
76
76
  getCountries(params) {
77
77
  return this.http
@@ -115,7 +115,7 @@ class StoresService {
115
115
  bulkInfraTicket(req) {
116
116
  return this.http
117
117
  .post(`${this.ticketsApiUrl}/infra/bulkcreateTicket`, req)
118
- .pipe(map((response) => response), catchError(this.handleError));
118
+ .pipe(map((response) => response));
119
119
  }
120
120
  handleError(error) {
121
121
  return throwError(() => new Error("Something bad happened; please try again later"));
@@ -1819,8 +1819,8 @@ class TangoManageStoresComponent {
1819
1819
  this.ts.getErrorToast("Unable to update Store Status!");
1820
1820
  }
1821
1821
  },
1822
- error: () => {
1823
- this.ts.getErrorToast("Unable to update Store Status!");
1822
+ error: (err) => {
1823
+ this.ts.getErrorToast(err.error.error);
1824
1824
  },
1825
1825
  complete: () => { },
1826
1826
  });
@@ -1994,7 +1994,7 @@ class AddStoresComponent {
1994
1994
  }
1995
1995
  },
1996
1996
  error: (err) => {
1997
- this.ts.getErrorToast('Unable to create store installation Tickets!');
1997
+ this.ts.getErrorToast(err.error.error);
1998
1998
  }
1999
1999
  });
2000
2000
  }
@@ -2005,7 +2005,7 @@ class AddStoresComponent {
2005
2005
  this.ts.getErrorToast(error);
2006
2006
  }
2007
2007
  else {
2008
- this.ts.getErrorToast("Unable to create stores!");
2008
+ this.ts.getErrorToast(error.error.error);
2009
2009
  }
2010
2010
  },
2011
2011
  });
@@ -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 {