Update Versi 1.5.27 #32
@@ -4,11 +4,11 @@ import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request, { params }:
|
||||
{ params: { status: string } }
|
||||
{ params: { name: string } }
|
||||
) {
|
||||
|
||||
|
||||
const { status } = params;
|
||||
const { name } = params;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const page = searchParams.get("page");
|
||||
const takeData = 10;
|
||||
@@ -16,7 +16,7 @@ export async function GET(request: Request, { params }:
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
const fixStatus = _.startCase(status);
|
||||
const fixStatus = _.startCase(name);
|
||||
|
||||
if (!page) {
|
||||
fixData = await prisma.projectCollaboration.findMany({
|
||||
@@ -6,9 +6,9 @@ import moment from "moment";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request,
|
||||
{ params }: { params: { status: string } }) {
|
||||
{ params }: { params: { name: string } }) {
|
||||
|
||||
const { status } = params;
|
||||
const { name } = params;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const search = searchParams.get("search");
|
||||
const page = searchParams.get("page");
|
||||
@@ -17,7 +17,7 @@ export async function GET(request: Request,
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
const fixStatus = _.startCase(status);
|
||||
const fixStatus = _.startCase(name);
|
||||
|
||||
|
||||
if (!page) {
|
||||
@@ -4,7 +4,7 @@ import moment from "moment";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request, { params }: {
|
||||
params: { status: string }
|
||||
params: { name: string }
|
||||
}
|
||||
) {
|
||||
const method = request.method;
|
||||
@@ -17,7 +17,7 @@ export async function GET(request: Request, { params }: {
|
||||
)
|
||||
}
|
||||
|
||||
const { status } = params;
|
||||
const { name } = params;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const search = searchParams.get("search");
|
||||
const page = searchParams.get("page");
|
||||
@@ -26,7 +26,7 @@ export async function GET(request: Request, { params }: {
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
const fixStatus = _.startCase(status);
|
||||
const fixStatus = _.startCase(name);
|
||||
|
||||
|
||||
if (!page) {
|
||||
@@ -6,7 +6,7 @@ import backendLogger from '@/util/backendLogger';
|
||||
import moment from 'moment';
|
||||
|
||||
export async function GET(request: Request, { params }: {
|
||||
params: { status: string }
|
||||
params: { name: string }
|
||||
}
|
||||
) {
|
||||
const method = request.method;
|
||||
@@ -18,7 +18,7 @@ export async function GET(request: Request, { params }: {
|
||||
{ status: 405 }
|
||||
)
|
||||
}
|
||||
const { status } = params;
|
||||
const { name } = params;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const search = searchParams.get("search");
|
||||
const page = searchParams.get("page");
|
||||
@@ -28,7 +28,7 @@ export async function GET(request: Request, { params }: {
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
const fixStatus = _.startCase(status);
|
||||
const fixStatus = _.startCase(name);
|
||||
|
||||
if (!page) {
|
||||
fixData = await prisma.job.findMany({
|
||||
@@ -4,7 +4,7 @@ import moment from "moment";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request,
|
||||
{ params }: { params: { status: string } }
|
||||
{ params }: { params: { name: string } }
|
||||
) {
|
||||
const method = request.method;
|
||||
if (method !== "GET") {
|
||||
@@ -16,7 +16,7 @@ export async function GET(request: Request,
|
||||
)
|
||||
}
|
||||
|
||||
const { status } = params;
|
||||
const { name } = params;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const search = searchParams.get("search");
|
||||
const page = searchParams.get("page");
|
||||
@@ -25,7 +25,7 @@ export async function GET(request: Request,
|
||||
|
||||
try {
|
||||
let fixData;
|
||||
const fixStatus = _.startCase(status);
|
||||
const fixStatus = _.startCase(name);
|
||||
|
||||
if (!page && !search) {
|
||||
fixData = await prisma.voting.findMany({
|
||||
@@ -25,8 +25,8 @@ const apiGetAdminCollaborationStatusCountDashboard = async ({
|
||||
// console.log("Ini Response", await response.json());
|
||||
return await response.json().catch(() => null);
|
||||
}
|
||||
const apiGetAdminCollaborationStatusById = async ({ status, page}: {
|
||||
status: "Publish" | "Reject",
|
||||
const apiGetAdminCollaborationStatusById = async ({ name, page}: {
|
||||
name: "Publish" | "Reject",
|
||||
page: string,
|
||||
|
||||
}) => {
|
||||
@@ -35,7 +35,7 @@ const apiGetAdminCollaborationStatusById = async ({ status, page}: {
|
||||
if (!token) return await token.json().catch(() => null);
|
||||
|
||||
const isPage = page ? `?page=${page}` : "";
|
||||
const response = await fetch(`/api/admin/collaboration/${status}${isPage}`, {
|
||||
const response = await fetch(`/api/admin/collaboration/${name}${isPage}`, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
|
||||
@@ -38,10 +38,10 @@ const apiGetAdminDonasiKategoriCountDashboard = async () => {
|
||||
}
|
||||
|
||||
const apiGetAdminDonasiByStatus = async ({
|
||||
status,
|
||||
name,
|
||||
page,
|
||||
search }: {
|
||||
status: "Publish" | "Review" | "Reject",
|
||||
name: "Publish" | "Review" | "Reject",
|
||||
page: string;
|
||||
search: string;
|
||||
}) => {
|
||||
@@ -52,7 +52,7 @@ const apiGetAdminDonasiByStatus = async ({
|
||||
const isPage = page ? `?page=${page}` : "";
|
||||
const isSearch = search ? `&search=${search}` : "";
|
||||
const response = await fetch(
|
||||
`/api/admin/donasi/${status}${isPage}${isSearch}`,
|
||||
`/api/admin/donasi/status/${name}${isPage}${isSearch}`,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
@@ -54,7 +54,7 @@ function TableStatus() {
|
||||
const loadInitialData = async () => {
|
||||
try {
|
||||
const response = await apiGetAdminDonasiByStatus({
|
||||
status: "Publish",
|
||||
name: "Publish",
|
||||
page: `${isActivePage}`,
|
||||
search: isSearch
|
||||
})
|
||||
|
||||
@@ -56,7 +56,7 @@ function TableStatus() {
|
||||
const loadInitialData = async () => {
|
||||
try {
|
||||
const response = await apiGetAdminDonasiByStatus({
|
||||
status: "Reject",
|
||||
name: "Reject",
|
||||
page: `${isActivePage}`,
|
||||
search: isSearch
|
||||
})
|
||||
|
||||
@@ -68,7 +68,7 @@ function TableStatus() {
|
||||
const loadInitialData = async () => {
|
||||
try {
|
||||
const response = await apiGetAdminDonasiByStatus({
|
||||
status: "Review",
|
||||
name: "Review",
|
||||
page: `${isActivePage}`,
|
||||
search: isSearch
|
||||
})
|
||||
|
||||
@@ -27,8 +27,8 @@ const apiGetAdminInvestasiCountDashboard = async ({ name }:
|
||||
return await response.json().catch(() => null);
|
||||
};
|
||||
|
||||
const apiGetAdminInvestasiByStatus = async ({ status, page, search }: {
|
||||
status: "Publish" | "Review" | "Reject",
|
||||
const apiGetAdminInvestasiByStatus = async ({ name, page, search }: {
|
||||
name: "Publish" | "Review" | "Reject",
|
||||
page: string,
|
||||
search: string
|
||||
}) => {
|
||||
@@ -40,7 +40,7 @@ const apiGetAdminInvestasiByStatus = async ({ status, page, search }: {
|
||||
|
||||
const isPage = page ? `?page=${page}` : "";
|
||||
const isSearch = search ? `&search=${search}` : "";
|
||||
const response = await fetch(`/api/admin/investasi/status/${status}${isPage}${isSearch}`, {
|
||||
const response = await fetch(`/api/admin/investasi/status/${name}${isPage}${isSearch}`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
@@ -241,6 +241,7 @@ export function AdminInvestasi_ViewDaftarTransaksi() {
|
||||
data={listStatus?.map(status => ({
|
||||
value: status.id,
|
||||
label: status.name,
|
||||
|
||||
})) || []}
|
||||
onChange={(val: any) => {
|
||||
console.log(val)
|
||||
|
||||
@@ -62,7 +62,7 @@ function TableView() {
|
||||
const loadInitialData = async () => {
|
||||
try {
|
||||
const response = await apiGetAdminInvestasiByStatus({
|
||||
status: "Publish",
|
||||
name: "Publish",
|
||||
page: `${activePage}`,
|
||||
search: isSearch,
|
||||
});
|
||||
|
||||
@@ -130,7 +130,7 @@ function TableView() {
|
||||
const loadInitialData = async () => {
|
||||
try {
|
||||
const response = await apiGetAdminInvestasiByStatus({
|
||||
status: "Reject",
|
||||
name: "Reject",
|
||||
page: `${activePage}`,
|
||||
search: isSearch,
|
||||
});
|
||||
|
||||
@@ -66,7 +66,7 @@ function TableView() {
|
||||
const loadInitialData = async () => {
|
||||
try {
|
||||
const response = await apiGetAdminInvestasiByStatus({
|
||||
status: "Review",
|
||||
name: "Review",
|
||||
page: `${activePage}`,
|
||||
search: isSearch,
|
||||
});
|
||||
|
||||
@@ -76,7 +76,7 @@ export default function AdminJob_ViewTavleReview() {
|
||||
const loadInitialData = async () => {
|
||||
try {
|
||||
const response = await apiGetAdminJobByStatus({
|
||||
status: "Review",
|
||||
name: "Review",
|
||||
page: `${activePage}`,
|
||||
search: isSearch
|
||||
})
|
||||
|
||||
@@ -56,7 +56,7 @@ function TableStatus() {
|
||||
const loadInitialData = async () => {
|
||||
try {
|
||||
const response = await apiGetAdminJobByStatus({
|
||||
status: "Publish",
|
||||
name: "Publish",
|
||||
page: `${activePage}`,
|
||||
search: isSearch
|
||||
})
|
||||
|
||||
@@ -64,7 +64,7 @@ function TableStatus() {
|
||||
const loadInitialData = async () => {
|
||||
try {
|
||||
const response = await apiGetAdminJobByStatus({
|
||||
status: "Reject",
|
||||
name: "Reject",
|
||||
page: `${activePage}`,
|
||||
search: isSearch
|
||||
});
|
||||
|
||||
@@ -39,11 +39,11 @@ const apiGetAdminJobArsipCount = async () => {
|
||||
|
||||
};
|
||||
const apiGetAdminJobByStatus = async ({
|
||||
status,
|
||||
name,
|
||||
page,
|
||||
search
|
||||
}: {
|
||||
status: "Publish" | "Review" | "Reject";
|
||||
name: "Publish" | "Review" | "Reject";
|
||||
page: string;
|
||||
search: string;
|
||||
}) => {
|
||||
@@ -53,7 +53,7 @@ const apiGetAdminJobByStatus = async ({
|
||||
const isPage = page ? `?page=${page}` : "";
|
||||
const isSearch = search ? `&search=${search}` : "";
|
||||
const response = await fetch(
|
||||
`/api/admin/job/${status}${isPage}${isSearch}`,
|
||||
`/api/admin/job/status/${name}${isPage}${isSearch}`,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
@@ -34,7 +34,7 @@ const middlewareConfig: MiddlewareConfig = {
|
||||
|
||||
// ADMIN API
|
||||
// >> buat dibawah sini <<
|
||||
"/api/admin/investasi/*",
|
||||
"api/admin/job/*",
|
||||
|
||||
|
||||
// Akses awal
|
||||
|
||||
Reference in New Issue
Block a user