Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ const useTableRequestError = () => {
return request
.then((response) => {
setRequestErrorMessage('');
if (
typeof response.data !== 'object' ||
response.data === null
) {
setRequestErrorMessage(
'Unexpected response format: expected JSON but received non-object data'
);
return { list: [], total: 0, otherData: {} };
}
if ('data' in response.data && 'total_nums' in response.data) {
const { data, total_nums, ...otherData } = response.data;
return {
Expand Down
Loading