mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-13 19:16:13 +01:00
Compare commits
1 Commits
1.19.1
...
improve-ca
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ff1211e66 |
@@ -12,6 +12,8 @@ import { getBalances, getSuggestedReimbursements } from '@/lib/balances'
|
|||||||
import { Metadata } from 'next'
|
import { Metadata } from 'next'
|
||||||
import { notFound } from 'next/navigation'
|
import { notFound } from 'next/navigation'
|
||||||
|
|
||||||
|
export const dynamic = 'force-static'
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'Balances',
|
title: 'Balances',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,11 @@ import { GroupForm } from '@/components/group-form'
|
|||||||
import { getGroup, getGroupExpensesParticipants, updateGroup } from '@/lib/api'
|
import { getGroup, getGroupExpensesParticipants, updateGroup } from '@/lib/api'
|
||||||
import { groupFormSchema } from '@/lib/schemas'
|
import { groupFormSchema } from '@/lib/schemas'
|
||||||
import { Metadata } from 'next'
|
import { Metadata } from 'next'
|
||||||
|
import { revalidatePath } from 'next/cache'
|
||||||
import { notFound, redirect } from 'next/navigation'
|
import { notFound, redirect } from 'next/navigation'
|
||||||
|
|
||||||
|
export const dynamic = 'force-static'
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'Settings',
|
title: 'Settings',
|
||||||
}
|
}
|
||||||
@@ -20,7 +23,11 @@ export default async function EditGroupPage({
|
|||||||
'use server'
|
'use server'
|
||||||
const groupFormValues = groupFormSchema.parse(values)
|
const groupFormValues = groupFormSchema.parse(values)
|
||||||
const group = await updateGroup(groupId, groupFormValues)
|
const group = await updateGroup(groupId, groupFormValues)
|
||||||
redirect(`/groups/${group.id}`)
|
revalidatePath(`/groups/${group.id}/expenses`)
|
||||||
|
revalidatePath(`/groups/${group.id}/expenses/create`)
|
||||||
|
revalidatePath(`/groups/${group.id}/balances`)
|
||||||
|
revalidatePath(`/groups/${group.id}/edit`)
|
||||||
|
redirect(`/groups/${group.id}/expenses`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const protectedParticipantIds = await getGroupExpensesParticipants(groupId)
|
const protectedParticipantIds = await getGroupExpensesParticipants(groupId)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
} from '@/lib/api'
|
} from '@/lib/api'
|
||||||
import { expenseFormSchema } from '@/lib/schemas'
|
import { expenseFormSchema } from '@/lib/schemas'
|
||||||
import { Metadata } from 'next'
|
import { Metadata } from 'next'
|
||||||
|
import { revalidatePath } from 'next/cache'
|
||||||
import { notFound, redirect } from 'next/navigation'
|
import { notFound, redirect } from 'next/navigation'
|
||||||
import { Suspense } from 'react'
|
import { Suspense } from 'react'
|
||||||
|
|
||||||
@@ -30,7 +31,9 @@ export default async function EditExpensePage({
|
|||||||
'use server'
|
'use server'
|
||||||
const expenseFormValues = expenseFormSchema.parse(values)
|
const expenseFormValues = expenseFormSchema.parse(values)
|
||||||
await updateExpense(groupId, expenseId, expenseFormValues)
|
await updateExpense(groupId, expenseId, expenseFormValues)
|
||||||
redirect(`/groups/${groupId}`)
|
revalidatePath(`/groups/${groupId}/expenses`)
|
||||||
|
revalidatePath(`/groups/${groupId}/balances`)
|
||||||
|
redirect(`/groups/${groupId}/expenses`)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteExpenseAction() {
|
async function deleteExpenseAction() {
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import { Metadata } from 'next'
|
|||||||
import { notFound, redirect } from 'next/navigation'
|
import { notFound, redirect } from 'next/navigation'
|
||||||
import { Suspense } from 'react'
|
import { Suspense } from 'react'
|
||||||
|
|
||||||
|
export const dynamic = 'force-static'
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'Create expense',
|
title: 'Create expense',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ import Link from 'next/link'
|
|||||||
import { notFound } from 'next/navigation'
|
import { notFound } from 'next/navigation'
|
||||||
import { Suspense } from 'react'
|
import { Suspense } from 'react'
|
||||||
|
|
||||||
|
export const dynamic = 'force-static'
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'Expenses',
|
title: 'Expenses',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { redirect } from 'next/navigation'
|
import { redirect } from 'next/navigation'
|
||||||
|
|
||||||
|
export const dynamic = 'force-static'
|
||||||
|
|
||||||
export default async function GroupPage({
|
export default async function GroupPage({
|
||||||
params: { groupId },
|
params: { groupId },
|
||||||
}: {
|
}: {
|
||||||
|
|||||||
Reference in New Issue
Block a user