@ -3,6 +3,7 @@ import { auth } from '../auth'
|
||||
import ky, { HTTPError } from 'ky'
|
||||
import { defaultBaseUrl } from '../constants'
|
||||
import { parseRecordsCreateBody } from '../helpers/parseRecordCreateBody'
|
||||
import { parseErrorResponse } from '../helpers/parseErrorResponse'
|
||||
|
||||
export const createRecord = createAction({
|
||||
auth,
|
||||
@ -52,7 +53,7 @@ export const createRecord = createAction({
|
||||
return logs.add({
|
||||
status: 'error',
|
||||
description: error.message,
|
||||
details: await error.response.text(),
|
||||
details: await parseErrorResponse(error.response),
|
||||
})
|
||||
console.error(error)
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import {
|
||||
defaultLimitForSearch,
|
||||
filterOperators,
|
||||
} from '../constants'
|
||||
import { parseErrorResponse } from '../helpers/parseErrorResponse'
|
||||
|
||||
export const searchRecords = createAction({
|
||||
auth,
|
||||
@ -127,7 +128,7 @@ export const searchRecords = createAction({
|
||||
return logs.add({
|
||||
status: 'error',
|
||||
description: error.message,
|
||||
details: await error.response.text(),
|
||||
details: await parseErrorResponse(error.response),
|
||||
})
|
||||
console.error(error)
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import {
|
||||
import { parseSearchParams } from '../helpers/parseSearchParams'
|
||||
import { convertFilterToWhereClause } from '../helpers/convertFilterToWhereClause'
|
||||
import { ListTableRecordsResponse } from '../types'
|
||||
import { parseErrorResponse } from '../helpers/parseErrorResponse'
|
||||
|
||||
export const updateExistingRecord = createAction({
|
||||
auth,
|
||||
@ -94,7 +95,7 @@ export const updateExistingRecord = createAction({
|
||||
return logs.add({
|
||||
status: 'error',
|
||||
description: error.message,
|
||||
details: await error.response.text(),
|
||||
details: await parseErrorResponse(error.response),
|
||||
})
|
||||
console.error(error)
|
||||
}
|
||||
|
Reference in New Issue
Block a user