Skip to content

Commit

Permalink
feat(admin): add revalidation after git clean
Browse files Browse the repository at this point in the history
  • Loading branch information
lsagetlethias committed Jan 16, 2025
1 parent dc6741b commit a5c69eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/@default/(authenticated)/admin/GitManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const GitManagement = () => {
const [gitResult, setGitResult] = useState<string>("");
return (
<FormFieldset
legend="Git management"
legend="Git management (all operations includes a revalidation of the layout cache)"
elements={[
<ButtonsGroup
key={0}
Expand Down
8 changes: 7 additions & 1 deletion src/app/@default/(authenticated)/admin/actions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
"use server";

import { revalidatePath } from "next/cache";

import { gitRepo } from "@/lib/repo";

export async function cleanGitLocalRepo() {
return gitRepo.cleanLocalRepo();
try {
return gitRepo.cleanLocalRepo();
} finally {
revalidatePath("/", "layout");
}
}

0 comments on commit a5c69eb

Please sign in to comment.