mirror of
https://github.com/inventree/InvenTree.git
synced 2026-09-02 10:18:42 +00:00
[UI] Refactor useQuery hooks (#9894)
* Improvements for table loading - Retry table queries on failure - Properly store failure modes - Increasing standoff time on query failure * Add error messages * Better error extraction * Simplify error handling * Update NotesEditor * Update dashboard items * Tweak table refetch * Refactor notifications query * Fix for calendar querty * Other fixes * Allow retry for search query * Further adjustments * Improved dashboard * Upate more useQuery hooks * Fix broken URL (was used for testing) * Remove custom delay * Revert change to noRecordsText
This commit is contained in:
@@ -92,11 +92,9 @@ export default function NotesEditor({
|
||||
|
||||
const dataQuery = useQuery({
|
||||
queryKey: ['notes-editor', noteUrl, modelType, modelId],
|
||||
retry: 5,
|
||||
queryFn: () =>
|
||||
api
|
||||
.get(noteUrl)
|
||||
.then((response) => response.data?.notes ?? '')
|
||||
.catch(() => ''),
|
||||
api.get(noteUrl).then((response) => response.data?.notes ?? ''),
|
||||
enabled: true
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user