@open-tender/cloud 0.1.16 → 0.1.17

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.
@@ -28,8 +28,7 @@ export declare const fetchGuestThanx: import("@reduxjs/toolkit").AsyncThunk<void
28
28
  email: string;
29
29
  }, {
30
30
  email: string;
31
- callback: (() => void) | null;
32
- origin?: string | undefined;
31
+ callback?: (() => void) | null | undefined;
33
32
  }, {
34
33
  state: AppState;
35
34
  rejectValue: RequestError;
@@ -17,29 +17,29 @@ var GuestActionType;
17
17
  GuestActionType["FetchGuest"] = "guest/fetchGuest";
18
18
  GuestActionType["FetchGuestThanx"] = "guest/fetchGuestThanx";
19
19
  })(GuestActionType = exports.GuestActionType || (exports.GuestActionType = {}));
20
- exports.fetchGuest = (0, toolkit_1.createAsyncThunk)(GuestActionType.FetchGuest, (requestData, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
20
+ exports.fetchGuest = (0, toolkit_1.createAsyncThunk)(GuestActionType.FetchGuest, ({ email, callback }, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
21
21
  const { api } = getState().config;
22
22
  if (!api)
23
23
  return;
24
24
  try {
25
- const response = yield api.getGuest(requestData.email);
26
- if (requestData.callback)
27
- requestData.callback();
25
+ const response = yield api.getGuest(email);
26
+ if (callback)
27
+ callback();
28
28
  return response;
29
29
  }
30
30
  catch (err) {
31
31
  return rejectWithValue(err);
32
32
  }
33
33
  }));
34
- exports.fetchGuestThanx = (0, toolkit_1.createAsyncThunk)(GuestActionType.FetchGuestThanx, (requestData, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
34
+ exports.fetchGuestThanx = (0, toolkit_1.createAsyncThunk)(GuestActionType.FetchGuestThanx, ({ email, callback }, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
35
35
  const { api } = getState().config;
36
36
  if (!api)
37
37
  return;
38
38
  try {
39
- yield api.postThanxLogin(requestData.email, origin);
40
- if (requestData.callback)
41
- requestData.callback();
42
- return { email: requestData.email };
39
+ yield api.postThanxLogin(email);
40
+ if (callback)
41
+ callback();
42
+ return { email: email };
43
43
  }
44
44
  catch (err) {
45
45
  return rejectWithValue(err);
@@ -28,8 +28,7 @@ export declare const fetchGuestThanx: import("@reduxjs/toolkit").AsyncThunk<void
28
28
  email: string;
29
29
  }, {
30
30
  email: string;
31
- callback: (() => void) | null;
32
- origin?: string | undefined;
31
+ callback?: (() => void) | null | undefined;
33
32
  }, {
34
33
  state: AppState;
35
34
  rejectValue: RequestError;
@@ -13,29 +13,29 @@ export var GuestActionType;
13
13
  GuestActionType["FetchGuest"] = "guest/fetchGuest";
14
14
  GuestActionType["FetchGuestThanx"] = "guest/fetchGuestThanx";
15
15
  })(GuestActionType || (GuestActionType = {}));
16
- export const fetchGuest = createAsyncThunk(GuestActionType.FetchGuest, (requestData, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
16
+ export const fetchGuest = createAsyncThunk(GuestActionType.FetchGuest, ({ email, callback }, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
17
17
  const { api } = getState().config;
18
18
  if (!api)
19
19
  return;
20
20
  try {
21
- const response = yield api.getGuest(requestData.email);
22
- if (requestData.callback)
23
- requestData.callback();
21
+ const response = yield api.getGuest(email);
22
+ if (callback)
23
+ callback();
24
24
  return response;
25
25
  }
26
26
  catch (err) {
27
27
  return rejectWithValue(err);
28
28
  }
29
29
  }));
30
- export const fetchGuestThanx = createAsyncThunk(GuestActionType.FetchGuestThanx, (requestData, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
30
+ export const fetchGuestThanx = createAsyncThunk(GuestActionType.FetchGuestThanx, ({ email, callback }, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
31
31
  const { api } = getState().config;
32
32
  if (!api)
33
33
  return;
34
34
  try {
35
- yield api.postThanxLogin(requestData.email, origin);
36
- if (requestData.callback)
37
- requestData.callback();
38
- return { email: requestData.email };
35
+ yield api.postThanxLogin(email);
36
+ if (callback)
37
+ callback();
38
+ return { email: email };
39
39
  }
40
40
  catch (err) {
41
41
  return rejectWithValue(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
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",