@open-tender/cloud 0.1.43 → 0.1.44

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.
@@ -5,7 +5,7 @@ export interface TagsState {
5
5
  error: RequestError;
6
6
  loading: RequestStatus;
7
7
  selectedTags: Tags;
8
- lookup: TagLookupEnhanced | null;
8
+ lookup: TagLookupEnhanced;
9
9
  }
10
10
  export declare enum TagsActionType {
11
11
  FetchTags = "tags/fetchTags"
@@ -45,13 +45,11 @@ const tagsSlice = (0, toolkit_1.createSlice)({
45
45
  state.selectedTags = action.payload;
46
46
  },
47
47
  toggleTag: (state, action) => {
48
- var _a;
49
48
  const tag = action.payload;
50
- const exists = (_a = state.selectedTags) === null || _a === void 0 ? void 0 : _a.find(i => i.tag_id === tag.tag_id);
51
- const current = state.selectedTags || [];
49
+ const exists = state.selectedTags.find(i => i.tag_id === tag.tag_id);
52
50
  state.selectedTags = exists
53
- ? current.filter(i => i.tag_id !== tag.tag_id)
54
- : [...current, tag];
51
+ ? state.selectedTags.filter(i => i.tag_id !== tag.tag_id)
52
+ : [...state.selectedTags, tag];
55
53
  }
56
54
  },
57
55
  extraReducers: builder => {
@@ -5,7 +5,7 @@ export interface TagsState {
5
5
  error: RequestError;
6
6
  loading: RequestStatus;
7
7
  selectedTags: Tags;
8
- lookup: TagLookupEnhanced | null;
8
+ lookup: TagLookupEnhanced;
9
9
  }
10
10
  export declare enum TagsActionType {
11
11
  FetchTags = "tags/fetchTags"
@@ -41,13 +41,11 @@ const tagsSlice = createSlice({
41
41
  state.selectedTags = action.payload;
42
42
  },
43
43
  toggleTag: (state, action) => {
44
- var _a;
45
44
  const tag = action.payload;
46
- const exists = (_a = state.selectedTags) === null || _a === void 0 ? void 0 : _a.find(i => i.tag_id === tag.tag_id);
47
- const current = state.selectedTags || [];
45
+ const exists = state.selectedTags.find(i => i.tag_id === tag.tag_id);
48
46
  state.selectedTags = exists
49
- ? current.filter(i => i.tag_id !== tag.tag_id)
50
- : [...current, tag];
47
+ ? state.selectedTags.filter(i => i.tag_id !== tag.tag_id)
48
+ : [...state.selectedTags, tag];
51
49
  }
52
50
  },
53
51
  extraReducers: builder => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
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",