@bjsdistribution/dms-client-return 0.0.35 → 0.0.37

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.35",
2
+ "version": "0.0.37",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -106,19 +106,21 @@ function SelectionFilter() {
106
106
  );
107
107
 
108
108
  if (filteredClient) {
109
- const mappedActions = filteredClient?.actions?.map((action: any) => ({
110
- label: action,
111
- value: action,
112
- }));
109
+ const mappedActions = Array.isArray(filteredClient?.actions)
110
+ ? filteredClient?.actions?.map((action: any) => ({
111
+ label: action,
112
+ value: action,
113
+ }))
114
+ : [];
113
115
 
114
116
  setActionTypeOptions(mappedActions);
115
117
 
116
- const mappedLocations = filteredClient?.return_locations?.map(
117
- (location: any) => ({
118
- label: location,
119
- value: location,
120
- })
121
- );
118
+ const mappedLocations = Array.isArray(filteredClient?.return_locations)
119
+ ? filteredClient?.return_locations?.map((location: any) => ({
120
+ label: location,
121
+ value: location,
122
+ }))
123
+ : [];
122
124
 
123
125
  setLocationOptions(mappedLocations);
124
126
  }
@@ -152,18 +154,23 @@ function SelectionFilter() {
152
154
  const clientLocations = selectedClientValue?.return_locations || [];
153
155
 
154
156
  setActionTypeOptions(
155
- clientActions?.map((action: any) => ({
156
- label: action,
157
- value: action,
158
- }))
157
+ Array.isArray(clientActions)
158
+ ? clientActions?.map(action => ({
159
+ label: action,
160
+ value: action,
161
+ }))
162
+ : []
159
163
  );
160
164
 
161
165
  setLocationOptions(
162
- clientLocations?.map((action: any) => ({
163
- label: action,
164
- value: action,
165
- }))
166
+ Array.isArray(clientLocations)
167
+ ? clientLocations?.map(location => ({
168
+ label: location,
169
+ value: location,
170
+ }))
171
+ : []
166
172
  );
173
+
167
174
  //client value
168
175
  if (storedClientId) {
169
176
  dispatch({
@@ -192,7 +199,7 @@ function SelectionFilter() {
192
199
  });
193
200
  }
194
201
  //location value
195
- if (selectedLocationValue && selectedLocationValue.length > 0) {
202
+ if (selectedLocationValue && selectedLocationValue?.length > 0) {
196
203
  dispatch({
197
204
  type: 'SET_LOCATION_FILTER',
198
205
  payload: selectedLocationValue,