@zeniai/client-epic-state 4.17.53 → 4.17.55
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.
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
2
3
|
import { RootState } from '../../../reducer';
|
|
3
4
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
5
|
import { sendEmailMagicLinkToUser, sendEmailMagicLinkToUserFailure, sendEmailMagicLinkToUserSuccess } from '../tenantReducer';
|
|
5
|
-
export type ActionType = ReturnType<typeof sendEmailMagicLinkToUser> | ReturnType<typeof sendEmailMagicLinkToUserSuccess> | ReturnType<typeof sendEmailMagicLinkToUserFailure>;
|
|
6
|
-
export declare const sendEmailMagicLinkToUserEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<
|
|
7
|
-
payload: {
|
|
8
|
-
codeVerifier: string;
|
|
9
|
-
};
|
|
10
|
-
type: "tenant/sendEmailMagicLinkToUserSuccess";
|
|
11
|
-
} | {
|
|
12
|
-
payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
13
|
-
type: "tenant/sendEmailMagicLinkToUserFailure";
|
|
14
|
-
}>;
|
|
6
|
+
export type ActionType = ReturnType<typeof sendEmailMagicLinkToUser> | ReturnType<typeof sendEmailMagicLinkToUserSuccess> | ReturnType<typeof openSnackbar> | ReturnType<typeof sendEmailMagicLinkToUserFailure>;
|
|
7
|
+
export declare const sendEmailMagicLinkToUserEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.sendEmailMagicLinkToUserEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
6
7
|
const responsePayload_1 = require("../../../responsePayload");
|
|
7
8
|
const tenantReducer_1 = require("../tenantReducer");
|
|
8
9
|
const toRequestPayload = (email) => ({
|
|
@@ -17,9 +18,22 @@ const sendEmailMagicLinkToUserEpic = (actions$, _, zeniAPI) => actions$.pipe((0,
|
|
|
17
18
|
return (0, rxjs_1.of)((0, tenantReducer_1.sendEmailMagicLinkToUserSuccess)(response.data.code_verifier));
|
|
18
19
|
}
|
|
19
20
|
else {
|
|
20
|
-
|
|
21
|
+
const actions = [];
|
|
22
|
+
actions.push((0, tenantReducer_1.sendEmailMagicLinkToUserFailure)(response.status));
|
|
23
|
+
if (response.status.code === 500) {
|
|
24
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
25
|
+
messageSection: 'send_email_magic_link_to_user',
|
|
26
|
+
messageText: 'failed',
|
|
27
|
+
type: 'error',
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
return (0, rxjs_1.from)(actions);
|
|
21
31
|
}
|
|
22
32
|
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, tenantReducer_1.sendEmailMagicLinkToUserFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Send magic link to user API call errored out: ' +
|
|
23
|
-
JSON.stringify(error))))
|
|
33
|
+
JSON.stringify(error))), (0, snackbarReducer_1.openSnackbar)({
|
|
34
|
+
messageSection: 'send_email_magic_link_to_user',
|
|
35
|
+
messageText: 'failed',
|
|
36
|
+
type: 'error',
|
|
37
|
+
}))));
|
|
24
38
|
}));
|
|
25
39
|
exports.sendEmailMagicLinkToUserEpic = sendEmailMagicLinkToUserEpic;
|
|
@@ -58,7 +58,7 @@ const fetchTreasurySetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
58
58
|
(0, setupViewReducer_1.updateSetupViewLocalStoreData)({
|
|
59
59
|
companyId: response.data.companies[0].company_id,
|
|
60
60
|
}),
|
|
61
|
-
(0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, '
|
|
61
|
+
(0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, 'treasury_setup'),
|
|
62
62
|
(0, treasurySetupViewReducer_1.fetchTreasurySetupViewSuccess)(),
|
|
63
63
|
];
|
|
64
64
|
return (0, rxjs_1.from)(actions);
|
|
@@ -77,7 +77,7 @@ const fetchTreasurySetupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
77
77
|
const { allBankAccountIds } = plaidAccountViewState['spend_management_setup'].accountDetails;
|
|
78
78
|
return (0, rxjs_1.of)((0, setupViewReducer_1.updateSetupViewLocalStoreData)({
|
|
79
79
|
companyId,
|
|
80
|
-
}), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, '
|
|
80
|
+
}), (0, plaidAccountViewReducer_1.updatePlaidAccountViewAccountDetails)(allBankAccountIds, 'treasury_setup'), (0, treasurySetupViewReducer_1.fetchTreasurySetupViewSuccess)());
|
|
81
81
|
}
|
|
82
82
|
}));
|
|
83
83
|
exports.fetchTreasurySetupViewEpic = fetchTreasurySetupViewEpic;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.17.
|
|
3
|
+
"version": "4.17.55",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|