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.

Add applied button

Khuram Niazd2401759a9e3
diff --git a/src/actions/job.actions.ts b/src/actions/job.actions.ts
index 5b4c9d7..2822126 100644
--- a/src/actions/job.actions.ts
+++ b/src/actions/job.actions.ts
@@ -211,6 +211,7 @@ export const addJob = async (
dateApplied,
jobDescription,
jobUrl,
+ applied,
} = data;
const job = await prisma.job.create({
@@ -228,6 +229,7 @@ export const addJob = async (
jobType: type,
userId: user.id,
jobUrl,
+ applied,
},
});
@@ -265,6 +267,7 @@ export const updateJob = async (
dateApplied,
jobDescription,
jobUrl,
+ applied,
} = data;
const job = await prisma.job.update({
@@ -284,6 +287,7 @@ export const updateJob = async (
description: jobDescription,
jobType: type,
jobUrl,
+ applied,
},
});
diff --git a/src/components/AddJob.tsx b/src/components/AddJob.tsx
index b10a6a0..6fdbbbf 100644
--- a/src/components/AddJob.tsx
+++ b/src/components/AddJob.tsx
@@ -42,6 +42,7 @@ import { DatePicker } from "./DatePicker";
import { SALARY_RANGES } from "@/lib/data/salaryRangeData";
import TiptapEditor from "./TiptapEditor";
import { Input } from "./ui/input";
+import { Switch } from "./ui/switch";
type AddJobProps = {
jobStatuses: JobStatus[];
@@ -95,6 +96,7 @@ export function AddJob({
setValue("dateApplied", editJob.appliedDate);
setValue("salaryRange", editJob.salaryRange);
setValue("jobDescription", editJob.description);
+ setValue("applied", editJob.applied);
if (editJob.jobUrl) {
setValue("jobUrl", editJob.jobUrl);
}
@@ -271,6 +273,28 @@ export function AddJob({
)}
/>
</div>
+
+ {/* Applied */}
+ <div className="flex items-center">
+ <FormField
+ control={form.control}
+ name="applied"
+ render={({ field }) => (
+ <FormItem className="flex flex-row">
+ <Switch
+ checked={field.value}
+ onCheckedChange={field.onChange}
+ />
+ <FormLabel className="flex items-center ml-4 mb-2">
+ {field.value ? "Applied" : "Not Applied"}
+ </FormLabel>
+
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ </div>
+
{/* Status */}
<div>
<FormField
diff --git a/src/components/JobDetails.tsx b/src/components/JobDetails.tsx
index 860d34d..b9c01b4 100644
--- a/src/components/JobDetails.tsx
+++ b/src/components/JobDetails.tsx
@@ -62,11 +62,14 @@ function JobDetails({ jobId }: { jobId: string }) {
{format(new Date(job?.appliedDate), "PP")}
</span>
</h3>
-
- <div className="my-3">
- <span className="font-semibold mr-2">Job URL:</span>
- <a href={job.jobUrl}>{job.jobUrl}</a>
- </div>
+ {job.jobUrl ? (
+ <div className="my-3">
+ <span className="font-semibold mr-2">Job URL:</span>
+ <a href={job.jobUrl} target="_blank">
+ {job.jobUrl}
+ </a>
+ </div>
+ ) : null}
<div className="my-4">
<EditorContent editor={editor} />
</div>
diff --git a/src/models/addJobForm.schema.ts b/src/models/addJobForm.schema.ts
index 9fccf92..fd4b29b 100644
--- a/src/models/addJobForm.schema.ts
+++ b/src/models/addJobForm.schema.ts
@@ -52,4 +52,5 @@ export const AddJobFormSchema = z.object({
message: "Job description must be at least 10 characters.",
}),
jobUrl: z.string().optional(),
+ applied: z.boolean().default(false),
});
diff --git a/src/models/job.model.ts b/src/models/job.model.ts
index 142cd66..63cce05 100644
--- a/src/models/job.model.ts
+++ b/src/models/job.model.ts
@@ -12,6 +12,25 @@ export interface JobForm {
salaryRange: string;
jobDescription: string;
jobUrl?: string;
+ applied: boolean;
+}
+
+export interface JobResponse {
+ id: string;
+ userId: string;
+ JobTitle: JobTitle;
+ Company: Company;
+ Status: JobStatus;
+ Location: JobLocation;
+ JobSource: JobSource;
+ jobType: string;
+ createdAt: Date;
+ appliedDate: Date;
+ dueDate: Date;
+ salaryRange: string;
+ description: string;
+ jobUrl: string;
+ applied: boolean;
}
export interface JobTitle {
@@ -59,23 +78,6 @@ export interface Country {
value: string;
}
-export interface JobResponse {
- id: string;
- userId: string;
- JobTitle: JobTitle;
- Company: Company;
- Status: JobStatus;
- Location: JobLocation;
- JobSource: JobSource;
- jobType: string;
- createdAt: Date;
- appliedDate: Date;
- dueDate: Date;
- salaryRange: string;
- description: string;
- jobUrl: string;
-}
-
export enum JOB_TYPES {
FT = "Full-time",
PT = "Part-time",