Skip to content

Commit

Permalink
added salary disclosed option & company extra info schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Kashyap1ankit committed Nov 11, 2024
1 parent e1069b7 commit c6f7333
Show file tree
Hide file tree
Showing 20 changed files with 481 additions and 177 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
DATABASE_URL=postgresql://postgres:hello@db:5432/jj?schema=public
# DATABASE_URL=postgresql://postgres:hello@db:5432/jj?schema=public #dockerwala

DATABASE_URL=postgresql://postgres:hello@localhost:5432/jj?schema=public
1 change: 0 additions & 1 deletion app/actions/posts/bookmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ export async function GetBookmarkByUserId(userId: string) {
apply_link: true,
company: true,
position: true,
role_name: true,
author: {
select: {
id: true,
Expand Down
10 changes: 3 additions & 7 deletions app/actions/posts/cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import prisma from "@/db";
import { calculateDayDiff } from "@/utils/helpers/calculate-day-difference";
import cron from "node-cron";

export async function deleteExpiredJobs() {
async function deleteExpiredJobs() {
try {
const allJobs = await prisma.post.findMany({
select: {
Expand Down Expand Up @@ -33,12 +33,8 @@ export async function deleteExpiredJobs() {
export const cleanDB = async () => {
cron.schedule(
"0 0 * * *", //running my delete jobs function everynight at 12am IST
() => {
deleteExpiredJobs();
},
{
scheduled: true,
timezone: "Asia/Kolkata",
async () => {
await deleteExpiredJobs();
}
);
};
6 changes: 3 additions & 3 deletions app/actions/posts/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function CreateJob(postdata: createJobSchemaType) {
location: postdata.location,
position: postdata.position,
role_description: postdata.role_description,
role_name: postdata.role_name,
salary_disclosed: postdata.salary_disclosed,
salary_max: postdata.salary_max,
salary_min: postdata.salary_min,
author: {
Expand Down Expand Up @@ -74,7 +74,7 @@ export async function GetAllPost() {
location: true,
position: true,
role_description: true,
role_name: true,
salary_disclosed: true,
salary_max: true,
salary_min: true,
author: {
Expand Down Expand Up @@ -127,7 +127,7 @@ export async function GetPostByAuthorId(authorId: string) {
location: true,
position: true,
role_description: true,
role_name: true,
salary_disclosed: true,
salary_max: true,
salary_min: true,
author: {
Expand Down
2 changes: 1 addition & 1 deletion app/api/jobs/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function POST(req: NextRequest, res: NextResponse) {
location: true,
position: true,
role_description: true,
role_name: true,

salary_max: true,
salary_min: true,
author: {
Expand Down
Loading

0 comments on commit c6f7333

Please sign in to comment.