Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

Fix: Revalidate company list in addjob when adding company

Khuram Niaz785c49b92ef6
diff --git a/src/actions/company.actions.ts b/src/actions/company.actions.ts
index 0631d32..488cf3e 100644
--- a/src/actions/company.actions.ts
+++ b/src/actions/company.actions.ts
@@ -2,6 +2,7 @@
import prisma from "@/lib/db";
import { AddCompanyFormSchema } from "@/models/addCompanyForm.schema";
import { getCurrentUser } from "@/utils/user.utils";
+import { revalidatePath } from "next/cache";
import { z } from "zod";
export const getCompanyList = async (
@@ -118,7 +119,7 @@ export const addCompany = async (
logoUrl,
},
});
-
+ revalidatePath("/dashboard/myjobs", "page");
return { success: true, data: res };
} catch (error) {
const msg = "Failed to create company.";
diff --git a/src/components/AddJob.tsx b/src/components/AddJob.tsx
index 4f15907..2e3dbeb 100644
--- a/src/components/AddJob.tsx
+++ b/src/components/AddJob.tsx
@@ -1,7 +1,6 @@
"use client";
import {
Dialog,
- DialogClose,
DialogContent,
DialogHeader,
DialogOverlay,
@@ -68,10 +67,9 @@ export function AddJob({
}: AddJobProps) {
const [dialogOpen, setDialogOpen] = useState(false);
const [isPending, startTransition] = useTransition();
-
+ console.log("add job");
const form = useForm<z.infer<typeof AddJobFormSchema>>({
resolver: zodResolver(AddJobFormSchema),
- // mode: "onChange",
defaultValues: {
type: Object.keys(JOB_TYPES)[0],
dueDate: addDays(new Date(), 3),