@open-tender/cloud 0.0.72 → 0.0.74

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.
@@ -77,7 +77,7 @@ exports.fetchCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.FetchC
77
77
  return (0, exports.checkAuth)(error, dispatch, () => rejectWithValue(error));
78
78
  }
79
79
  }));
80
- exports.loginCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, (data, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
80
+ exports.loginCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, (data, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
81
81
  try {
82
82
  const { email, password } = data;
83
83
  const api = getState().config.api;
@@ -87,6 +87,9 @@ exports.loginCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginC
87
87
  catch (err) {
88
88
  return rejectWithValue(err);
89
89
  }
90
+ finally {
91
+ dispatch((0, exports.fetchCustomer)());
92
+ }
90
93
  }));
91
94
  exports.logoutCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LogoutCustomer, (isReset, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
92
95
  try {
@@ -129,7 +132,7 @@ exports.linkPosToken = (0, toolkit_1.createAsyncThunk)(AccountActionType.LinkPos
129
132
  throw new Error(types_2.MISSING_CUSTOMER);
130
133
  yield api.postCustomerPosToken(token, posToken);
131
134
  dispatch((0, notifications_1.showNotification)('Order successfully linked!'));
132
- dispatch(exports.fetchCustomer);
135
+ dispatch((0, exports.fetchCustomer)());
133
136
  return;
134
137
  }
135
138
  catch (err) {
@@ -72,7 +72,7 @@ export const fetchCustomer = createAsyncThunk(AccountActionType.FetchCustomer,
72
72
  return checkAuth(error, dispatch, () => rejectWithValue(error));
73
73
  }
74
74
  }));
75
- export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, (data, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
75
+ export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, (data, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
76
76
  try {
77
77
  const { email, password } = data;
78
78
  const api = getState().config.api;
@@ -82,6 +82,9 @@ export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, (
82
82
  catch (err) {
83
83
  return rejectWithValue(err);
84
84
  }
85
+ finally {
86
+ dispatch(fetchCustomer());
87
+ }
85
88
  }));
86
89
  export const logoutCustomer = createAsyncThunk(AccountActionType.LogoutCustomer, (isReset, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
87
90
  try {
@@ -124,7 +127,7 @@ export const linkPosToken = createAsyncThunk(AccountActionType.LinkPosToken, (po
124
127
  throw new Error(MISSING_CUSTOMER);
125
128
  yield api.postCustomerPosToken(token, posToken);
126
129
  dispatch(showNotification('Order successfully linked!'));
127
- dispatch(fetchCustomer);
130
+ dispatch(fetchCustomer());
128
131
  return;
129
132
  }
130
133
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.0.72",
3
+ "version": "0.0.74",
4
4
  "description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -56,6 +56,6 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@open-tender/types": "^0.0.90",
59
- "@open-tender/utils": "^0.0.23"
59
+ "@open-tender/utils": "^0.0.28"
60
60
  }
61
61
  }