mirror of
https://github.com/spliit-app/spliit.git
synced 2026-03-11 14:29:05 +01:00
Use React’s cache to avoid some queries to the database
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { cached } from '@/app/cached-functions'
|
||||
import { ExpenseForm } from '@/components/expense-form'
|
||||
import {
|
||||
deleteExpense,
|
||||
getCategories,
|
||||
getExpense,
|
||||
getGroup,
|
||||
updateExpense,
|
||||
} from '@/lib/api'
|
||||
import { expenseFormSchema } from '@/lib/schemas'
|
||||
@@ -21,7 +21,7 @@ export default async function EditExpensePage({
|
||||
params: { groupId: string; expenseId: string }
|
||||
}) {
|
||||
const categories = await getCategories()
|
||||
const group = await getGroup(groupId)
|
||||
const group = await cached.getGroup(groupId)
|
||||
if (!group) notFound()
|
||||
const expense = await getExpense(groupId, expenseId)
|
||||
if (!expense) notFound()
|
||||
|
||||
Reference in New Issue
Block a user