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 joburl

Khuram Niaz86586476e13a
diff --git a/src/actions/job.actions.ts b/src/actions/job.actions.ts
index 74e913d..5b4c9d7 100644
--- a/src/actions/job.actions.ts
+++ b/src/actions/job.actions.ts
@@ -210,6 +210,7 @@ export const addJob = async (
dueDate,
dateApplied,
jobDescription,
+ jobUrl,
} = data;
const job = await prisma.job.create({
@@ -226,6 +227,7 @@ export const addJob = async (
description: jobDescription,
jobType: type,
userId: user.id,
+ jobUrl,
},
});
@@ -262,6 +264,7 @@ export const updateJob = async (
dueDate,
dateApplied,
jobDescription,
+ jobUrl,
} = data;
const job = await prisma.job.update({
@@ -280,6 +283,7 @@ export const updateJob = async (
appliedDate: dateApplied,
description: jobDescription,
jobType: type,
+ jobUrl,
},
});
diff --git a/src/components/AddJob.tsx b/src/components/AddJob.tsx
index f84b170..b10a6a0 100644
--- a/src/components/AddJob.tsx
+++ b/src/components/AddJob.tsx
@@ -41,6 +41,7 @@ import SelectFormCtrl from "./Select";
import { DatePicker } from "./DatePicker";
import { SALARY_RANGES } from "@/lib/data/salaryRangeData";
import TiptapEditor from "./TiptapEditor";
+import { Input } from "./ui/input";
type AddJobProps = {
jobStatuses: JobStatus[];
@@ -94,6 +95,9 @@ export function AddJob({
setValue("dateApplied", editJob.appliedDate);
setValue("salaryRange", editJob.salaryRange);
setValue("jobDescription", editJob.description);
+ if (editJob.jobUrl) {
+ setValue("jobUrl", editJob.jobUrl);
+ }
setDialogOpen(true);
}
}, [editJob, setValue]);
@@ -140,6 +144,26 @@ export function AddJob({
onSubmit={form.handleSubmit(onSubmit)}
className="grid grid-cols-1 md:grid-cols-2 gap-4 p-4"
>
+ {/* Job URL */}
+ <div className="md:col-span-2">
+ <FormField
+ control={form.control}
+ name="jobUrl"
+ render={({ field }) => (
+ <FormItem className="flex flex-col">
+ <FormLabel>Job URL</FormLabel>
+ <FormControl>
+ <Input
+ placeholder="Copy and paste job link here"
+ {...field}
+ />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ </div>
+
{/* Job Title */}
<div>
<FormField
diff --git a/src/components/ComboBox.tsx b/src/components/ComboBox.tsx
index a76abc1..c6a9617 100644
--- a/src/components/ComboBox.tsx
+++ b/src/components/ComboBox.tsx
@@ -24,7 +24,7 @@ import { useState, useTransition } from "react";
import { delay } from "@/utils/delay";
import { createJobTitle, createLocation } from "@/actions/job.actions";
import { JobForm } from "@/models/job.model";
-import { createCompany } from "@/actions/company.actions";
+import { addCompany } from "@/actions/company.actions";
interface ComboboxProps {
options: any[];
@@ -44,7 +44,8 @@ export function Combobox({ options, field, creatable }: ComboboxProps) {
let response;
switch (field.name) {
case "company":
- response = await createCompany(label);
+ const res = await addCompany({ company: label });
+ response = res.data;
break;
case "title":
response = await createJobTitle(label);
diff --git a/src/components/JobDetails.tsx b/src/components/JobDetails.tsx
index 7c40fc5..860d34d 100644
--- a/src/components/JobDetails.tsx
+++ b/src/components/JobDetails.tsx
@@ -14,9 +14,11 @@ import { EditorContent, useEditor } from "@tiptap/react";
import StarterKit from "@tiptap/starter-kit";
import { Badge } from "./ui/badge";
import { cn } from "@/lib/utils";
+import Link from "next/link";
+import { JobResponse } from "@/models/job.model";
function JobDetails({ jobId }: { jobId: string }) {
- const [job, setJob] = useState<any>({});
+ const [job, setJob] = useState<JobResponse>();
const editor = useEditor({
extensions: [StarterKit],
content: "",
@@ -42,7 +44,6 @@ function JobDetails({ jobId }: { jobId: string }) {
{job?.Location?.label} - {job?.jobType}
</DialogDescription>
</DialogHeader>
-
<h3>
{new Date() > job.dueDate && job.Status?.value === "draft" ? (
<Badge className="bg-red-500">Expired</Badge>
@@ -61,6 +62,11 @@ 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>
<div className="my-4">
<EditorContent editor={editor} />
</div>
diff --git a/src/models/addCompanyForm.schema.ts b/src/models/addCompanyForm.schema.ts
index 4305aec..5d2ca6a 100644
--- a/src/models/addCompanyForm.schema.ts
+++ b/src/models/addCompanyForm.schema.ts
@@ -8,5 +8,5 @@ export const AddCompanyFormSchema = z.object({
required_error: "Company name is required.",
})
.min(1),
- logoUrl: z.string().optional().default(""),
+ logoUrl: z.string().default("").optional(),
});
diff --git a/src/models/addJobForm.schema.ts b/src/models/addJobForm.schema.ts
index e077156..9fccf92 100644
--- a/src/models/addJobForm.schema.ts
+++ b/src/models/addJobForm.schema.ts
@@ -51,4 +51,5 @@ export const AddJobFormSchema = z.object({
jobDescription: z.string().min(10, {
message: "Job description must be at least 10 characters.",
}),
+ jobUrl: z.string().optional(),
});
diff --git a/src/models/job.model.ts b/src/models/job.model.ts
index 4402fe6..142cd66 100644
--- a/src/models/job.model.ts
+++ b/src/models/job.model.ts
@@ -11,6 +11,7 @@ export interface JobForm {
dateApplied: Date;
salaryRange: string;
jobDescription: string;
+ jobUrl?: string;
}
export interface JobTitle {
@@ -72,6 +73,7 @@ export interface JobResponse {
dueDate: Date;
salaryRange: string;
description: string;
+ jobUrl: string;
}
export enum JOB_TYPES {