diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 9cce067..70c8876 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -90,7 +90,7 @@ function Home() { // ============================================ const addCoffeeDialogId = 'addCoffeeDialog' async function postNewCoffee() { - postNewEntry( + await postNewEntry( 'coffee', { name: addCoffeeName, @@ -98,7 +98,7 @@ function Home() { notes: addCoffeeNotes, } ) - queryClient.invalidateQueries({ queryKey: ['coffees'] }) + await queryClient.refetchQueries({ queryKey: ['coffees'] }) closeDialog(addCoffeeDialogId) } function renderAddCoffeeDialog() { @@ -134,14 +134,14 @@ function Home() { // ============================================ const addGrinderDialogId = 'addGrinderDialog' async function postNewGrinder() { - postNewEntry( + await postNewEntry( 'grinder', { name: addGrinderName, notes: addGrinderNotes, } ) - queryClient.invalidateQueries({ queryKey: ['grinders'] }) + await queryClient.refetchQueries({ queryKey: ['grinders'] }) closeDialog(addGrinderDialogId) } function renderAddGrinderDialog() { @@ -172,14 +172,14 @@ function Home() { // ============================================ const addBrewerDialogId = 'addBrewerDialog' async function postNewBrewer() { - postNewEntry( + await postNewEntry( 'brewer', { name: addBrewerName, notes: addBrewerNotes, } ) - queryClient.invalidateQueries({ queryKey: ['brewers'] }) + await queryClient.refetchQueries({ queryKey: ['brewers'] }) closeDialog(addBrewerDialogId) } function renderAddBrewerDialog() { @@ -210,7 +210,7 @@ function Home() { // ============================================ const addMethodDialogId = 'addMethodDialog' async function postNewMethod() { - postNewEntry( + await postNewEntry( 'method', { coffeeId: addMethodCoffeeId, @@ -225,7 +225,7 @@ function Home() { notes: addMethodNotes, } ) - queryClient.invalidateQueries({ queryKey: ['methods'] }) + await queryClient.refetchQueries({ queryKey: ['methods'] }) closeDialog(addMethodDialogId) } function renderAddMethodDialog() {