# style
- UI Job di bagian user selesai

# fix
- Scroll data untuk beranda dan tampilan yang lain selesi

## No issue
This commit is contained in:
2024-07-05 16:29:54 +08:00
parent bca5a2ac15
commit ac12dd4a98
93 changed files with 2008 additions and 901 deletions

View File

@@ -3,13 +3,23 @@
import prisma from "@/app/lib/prisma";
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
export async function Job_getListAllArsipById() {
export async function job_getAllArsipById({page}: {page: number}) {
const authorId = await user_getOneUserId();
const takeData = 10;
const skipData = page * takeData - takeData;
const get = await prisma.job.findMany({
take: takeData,
skip: skipData,
orderBy: {
updatedAt: "desc",
},
where: {
authorId: authorId,
isArsip: true,
isActive: true,
},
});

View File

@@ -0,0 +1,45 @@
"use server";
import prisma from "@/app/lib/prisma";
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
export async function job_getAllListPublish({
page,
search,
}: {
page: any;
search?: string;
}) {
const takeData = 5;
const skipData = page * takeData - takeData;
const data = await prisma.job.findMany({
take: takeData,
skip: skipData,
orderBy: {
updatedAt: "desc",
},
where: {
masterStatusId: "1",
isActive: true,
isArsip: false,
title: {
mode: "insensitive",
contains: search,
},
},
select: {
id: true,
title: true,
Author: {
select: {
id: true,
username: true,
Profile: true,
},
},
},
});
return data;
}

View File

@@ -1,68 +0,0 @@
"use server";
import prisma from "@/app/lib/prisma";
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
export async function Job_getListStatusByStatusId(statusId: string) {
const authorId = await user_getOneUserId();
if (statusId === "1") {
const data = await prisma.job.findMany({
orderBy: {
updatedAt: "desc",
},
where: {
masterStatusId: "1",
authorId: authorId,
isActive: true,
isArsip: false
},
});
return data;
}
if (statusId === "2") {
const data = await prisma.job.findMany({
orderBy: {
updatedAt: "desc",
},
where: {
masterStatusId: "2",
authorId: authorId,
isActive: true,
},
});
return data;
}
if (statusId === "3") {
const data = await prisma.job.findMany({
orderBy: {
updatedAt: "desc",
},
where: {
masterStatusId: "3",
authorId: authorId,
isActive: true,
},
});
return data;
}
if (statusId === "4") {
const data = await prisma.job.findMany({
orderBy: {
updatedAt: "desc",
},
where: {
masterStatusId: "4",
authorId: authorId,
isActive: true,
},
});
return data;
}
}

View File

@@ -2,7 +2,7 @@
import prisma from "@/app/lib/prisma";
export async function Job_getOneById(jobId: any) {
export async function job_getOneById(jobId: any) {
const get = await prisma.job.findFirst({
where: {
id: jobId,

View File

@@ -0,0 +1,29 @@
"use server";
import prisma from "@/app/lib/prisma";
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
export default async function job_getAllStatusDraft({
page,
}: {
page: number;
}) {
const takeData = 10;
const skipData = page * takeData - takeData;
const authorId = await user_getOneUserId();
const data = await prisma.job.findMany({
take: takeData,
skip: skipData,
orderBy: {
updatedAt: "desc",
},
where: {
masterStatusId: "3",
authorId: authorId,
isActive: true,
},
});
return data;
}

View File

@@ -3,25 +3,27 @@
import prisma from "@/app/lib/prisma";
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
export async function Job_getAllListPublish() {
export default async function job_getAllStatusPublish({
page,
}: {
page: number;
}) {
const takeData = 10;
const skipData = page * takeData - takeData;
const authorId = await user_getOneUserId();
const data = await prisma.job.findMany({
take: takeData,
skip: skipData,
orderBy: {
updatedAt: "desc",
},
where: {
masterStatusId: "1",
authorId: authorId,
isActive: true,
isArsip: false,
},
select: {
id: true,
title: true,
Author: {
select: {
Profile: true
}
}
}
});
return data;

View File

@@ -0,0 +1,29 @@
"use server";
import prisma from "@/app/lib/prisma";
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
export default async function job_getAllStatusReject({
page,
}: {
page: number;
}) {
const takeData = 10;
const skipData = page * takeData - takeData;
const authorId = await user_getOneUserId();
const data = await prisma.job.findMany({
take: takeData,
skip: skipData,
orderBy: {
updatedAt: "desc",
},
where: {
masterStatusId: "4",
authorId: authorId,
isActive: true,
},
});
return data;
}

View File

@@ -3,15 +3,24 @@
import prisma from "@/app/lib/prisma";
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
export default async function job_getListReject({}: {}) {
const userId = await user_getOneUserId();
export default async function job_getAllStatusReview({
page,
}: {
page: number;
}) {
const takeData = 10;
const skipData = page * takeData - takeData;
const authorId = await user_getOneUserId();
const data = await prisma.job.findMany({
take: takeData,
skip: skipData,
orderBy: {
updatedAt: "desc",
},
where: {
masterStatusId: "2",
authorId: userId,
authorId: authorId,
isActive: true,
},
});