@zeniai/client-epic-state 4.19.99-betaRD4 → 4.19.99-betaRD5
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.
- package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +24 -4
- package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +24 -4
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +14 -1
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +23 -3
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +14 -1
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +23 -3
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { from
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
3
4
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
5
|
import { cancelAiAccountantOnboarding, cancelAiAccountantOnboardingFailure, cancelAiAccountantOnboardingSuccess, fetchAiAccountantCustomers, } from '../aiAccountantViewReducer';
|
|
5
6
|
export const cancelAiAccountantOnboardingEpic = (actions$, _, zeniAPI) => actions$.pipe(filter(cancelAiAccountantOnboarding.match), mergeMap((action) => {
|
|
@@ -16,11 +17,30 @@ export const cancelAiAccountantOnboardingEpic = (actions$, _, zeniAPI) => action
|
|
|
16
17
|
return from([
|
|
17
18
|
cancelAiAccountantOnboardingSuccess(tenantId),
|
|
18
19
|
fetchAiAccountantCustomers(),
|
|
20
|
+
openSnackbar({
|
|
21
|
+
messageSection: 'common',
|
|
22
|
+
messageText: 'success',
|
|
23
|
+
type: 'success',
|
|
24
|
+
}),
|
|
19
25
|
]);
|
|
20
26
|
}
|
|
21
27
|
else {
|
|
22
|
-
return
|
|
28
|
+
return from([
|
|
29
|
+
cancelAiAccountantOnboardingFailure(tenantId, response.status),
|
|
30
|
+
openSnackbar({
|
|
31
|
+
messageSection: 'common',
|
|
32
|
+
messageText: 'failed',
|
|
33
|
+
type: 'error',
|
|
34
|
+
}),
|
|
35
|
+
]);
|
|
23
36
|
}
|
|
24
|
-
}), catchError((error) =>
|
|
25
|
-
|
|
37
|
+
}), catchError((error) => from([
|
|
38
|
+
cancelAiAccountantOnboardingFailure(tenantId, createZeniAPIStatus('Unexpected error', 'AI Accountant cancel onboarding failed: ' +
|
|
39
|
+
JSON.stringify(error))),
|
|
40
|
+
openSnackbar({
|
|
41
|
+
messageSection: 'common',
|
|
42
|
+
messageText: 'failed',
|
|
43
|
+
type: 'error',
|
|
44
|
+
}),
|
|
45
|
+
])));
|
|
26
46
|
}));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { from
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
3
4
|
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
5
|
import { fetchAiAccountantCustomers, triggerAiAccountantJob, triggerAiAccountantJobFailure, triggerAiAccountantJobSuccess, } from '../aiAccountantViewReducer';
|
|
5
6
|
export const triggerAiAccountantJobEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(triggerAiAccountantJob.match), mergeMap((action) => {
|
|
@@ -29,11 +30,30 @@ export const triggerAiAccountantJobEpic = (actions$, state$, zeniAPI) => actions
|
|
|
29
30
|
return from([
|
|
30
31
|
triggerAiAccountantJobSuccess(),
|
|
31
32
|
fetchAiAccountantCustomers(),
|
|
33
|
+
openSnackbar({
|
|
34
|
+
messageSection: 'common',
|
|
35
|
+
messageText: 'success',
|
|
36
|
+
type: 'success',
|
|
37
|
+
}),
|
|
32
38
|
]);
|
|
33
39
|
}
|
|
34
40
|
else {
|
|
35
|
-
return
|
|
41
|
+
return from([
|
|
42
|
+
triggerAiAccountantJobFailure(response.status),
|
|
43
|
+
openSnackbar({
|
|
44
|
+
messageSection: 'common',
|
|
45
|
+
messageText: 'failed',
|
|
46
|
+
type: 'error',
|
|
47
|
+
}),
|
|
48
|
+
]);
|
|
36
49
|
}
|
|
37
|
-
}), catchError((error) =>
|
|
38
|
-
|
|
50
|
+
}), catchError((error) => from([
|
|
51
|
+
triggerAiAccountantJobFailure(createZeniAPIStatus('Unexpected error', 'AI Accountant trigger job failed: ' +
|
|
52
|
+
JSON.stringify(error))),
|
|
53
|
+
openSnackbar({
|
|
54
|
+
messageSection: 'common',
|
|
55
|
+
messageText: 'failed',
|
|
56
|
+
type: 'error',
|
|
57
|
+
}),
|
|
58
|
+
])));
|
|
39
59
|
}));
|