await POST calls and refetch call
This commit is contained in:
parent
3d0e9206cd
commit
dbc26163d0
1 changed files with 8 additions and 8 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue