Skip to content

Commit

Permalink
refactor: update breadcrumb links to point to project page instead of…
Browse files Browse the repository at this point in the history
… notices page

fix: update revalidatePath calls to point to project page instead of notices page to avoid 404 errors
  • Loading branch information
masterkain committed May 26, 2023
1 parent 6280d45 commit d13bf38
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/occurrences/[occurrence_id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default async function Occurrence({
const breadcrumbs = [
{
name: `${project.organization.toLowerCase()} / ${project.name.toLowerCase()}`,
href: `/projects/${project.id}/notices` as Route,
href: `/projects/${project.id}` as Route,
current: false,
},
{ name: notice.kind, href: `/notices/${notice.id}` as Route, current: false },
Expand Down
2 changes: 1 addition & 1 deletion app/projects/[project_id]/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default async function Project({
const breadcrumbs = [
{
name: `${project.organization.toLowerCase()} / ${project.name.toLowerCase()}`,
href: `/projects/${project.id}/notices` as Route,
href: `/projects/${project.id}` as Route,
current: false,
},
{
Expand Down
2 changes: 1 addition & 1 deletion app/projects/[project_id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default async function ProjectNotices({
const breadcrumbs = [
{
name: `${project.organization.toLowerCase()} / ${project.name.toLowerCase()}`,
href: `/projects/${project.id}/notices` as Route,
href: `/projects/${project.id}` as Route,
current: true,
},
];
Expand Down
2 changes: 1 addition & 1 deletion lib/actions/airbrakeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function sendAirbrakeNodeException(projectId: string, host: string)

try {
revalidatePath(`/projects`)
revalidatePath(`/projects/${project.id}/notices`)
revalidatePath(`/projects/${project.id}`)
} catch (err) {
console.warn(err);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/actions/projectActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function deleteProjectNotices(projectId: string): Promise<void> {

// Run revalidatePath on each project ID in parallel
await Promise.all(
projectIds.map((id) => revalidatePath(`/projects/${id}/notices`))
projectIds.map((id) => revalidatePath(`/projects/${id}`))
);
revalidatePath('/projects');
}
Expand Down

0 comments on commit d13bf38

Please sign in to comment.