File tree Expand file tree Collapse file tree 6 files changed +30
-2
lines changed
Expand file tree Collapse file tree 6 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ export async function lostBorrowAction(
2727 }
2828 return { error : 'failed to mark as lost' }
2929 } finally {
30- revalidatePath ( '/admin/borrows' )
30+ revalidatePath ( `/admin/borrows/${ data . id } ` )
31+ revalidatePath ( `/admin/borrows` )
32+ revalidatePath ( `/borrows/${ data . id } ` )
33+ revalidatePath ( '/borrows' )
34+ revalidatePath ( '/admin/books' )
35+ revalidatePath ( '/books' )
3136 }
3237}
Original file line number Diff line number Diff line change @@ -37,5 +37,10 @@ export async function returnBorrowAction({
3737 return { error : 'failed to return borrow' }
3838 } finally {
3939 revalidatePath ( `/admin/borrows/${ id } ` )
40+ revalidatePath ( `/admin/borrows` )
41+ revalidatePath ( `/borrows/${ id } ` )
42+ revalidatePath ( '/borrows' )
43+ revalidatePath ( '/admin/books' )
44+ revalidatePath ( '/books' )
4045 }
4146}
Original file line number Diff line number Diff line change @@ -29,5 +29,10 @@ export async function undoLostAction(id: string) {
2929 return { error : 'failed to undo lost' }
3030 } finally {
3131 revalidatePath ( `/admin/borrows/${ id } ` )
32+ revalidatePath ( `/admin/borrows` )
33+ revalidatePath ( `/borrows/${ id } ` )
34+ revalidatePath ( '/borrows' )
35+ revalidatePath ( '/admin/books' )
36+ revalidatePath ( '/books' )
3237 }
3338}
Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ export async function undoReturnAction(id: string) {
2525 }
2626 return { error : 'failed to undo return' }
2727 } finally {
28+ revalidatePath ( `/admin/borrows/${ id } ` )
29+ revalidatePath ( `/admin/borrows` )
30+ revalidatePath ( `/borrows/${ id } ` )
2831 revalidatePath ( '/borrows' )
32+ revalidatePath ( '/admin/books' )
33+ revalidatePath ( '/books' )
2934 }
3035}
Original file line number Diff line number Diff line change @@ -23,5 +23,8 @@ export async function updateBorrowAction(
2323 return { error : 'failed to update borrow' }
2424 } finally {
2525 revalidatePath ( `/admin/borrows/${ data . id } ` )
26+ revalidatePath ( `/admin/borrows` )
27+ revalidatePath ( `/borrows/${ data . id } ` )
28+ revalidatePath ( '/borrows' )
2629 }
2730}
Original file line number Diff line number Diff line change @@ -48,7 +48,12 @@ export const getBook = async (query: GetBookQuery): GetBookResponse => {
4848 url . searchParams . append ( key , String ( value ) )
4949 }
5050 } )
51- const response = await fetch ( url . toString ( ) )
51+ const response = await fetch ( url . toString ( ) , {
52+ cache : 'force-cache' ,
53+ next : {
54+ revalidate : 30 ,
55+ } ,
56+ } )
5257 return response . json ( )
5358}
5459
You can’t perform that action at this time.
0 commit comments