File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
adminforth/spa/src/components Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,12 @@ async function loadMoreOptions(columnName, searchTerm = '') {
205205 },
206206 });
207207
208+ if (! list || ! Array .isArray (list .items )) {
209+ console .warn (` Unexpected API response for column ${ columnName} :` , list);
210+ state .hasMore = false ;
211+ return ;
212+ }
213+
208214 if (! columnOptions .value [columnName]) {
209215 columnOptions .value [columnName] = [];
210216 }
@@ -247,6 +253,12 @@ async function searchOptions(columnName, searchTerm) {
247253 },
248254 });
249255
256+ if (! list || ! Array .isArray (list .items )) {
257+ console .warn (` Unexpected API response for column ${ columnName} :` , list);
258+ state .hasMore = false ;
259+ return ;
260+ }
261+
250262 columnOptions .value [columnName] = list .items ;
251263 columnOffsets[columnName] = 100 ;
252264 state .hasMore = list .items .length === 100 ;
You can’t perform that action at this time.
0 commit comments