feat: merge main
This commit is contained in:
commit
9642db046d
|
|
@ -0,0 +1,29 @@
|
|||
stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
build-dev:
|
||||
stage: build
|
||||
when: on_success
|
||||
only:
|
||||
- main
|
||||
image: docker:stable
|
||||
services:
|
||||
- name: docker:dind
|
||||
command: ["--insecure-registry=103.82.242.92:8900"]
|
||||
script:
|
||||
- docker logout
|
||||
- docker login -u $DEPLOY_USERNAME -p $DEPLOY_TOKEN 103.82.242.92:8900
|
||||
- docker build -t 103.82.242.92:8900/mediahub/new-mediahub-fe:dev .
|
||||
- docker push 103.82.242.92:8900/mediahub/new-mediahub-fe:dev
|
||||
|
||||
auto-deploy:
|
||||
stage: deploy
|
||||
when: on_success
|
||||
only:
|
||||
- main
|
||||
image: curlimages/curl:latest
|
||||
services:
|
||||
- docker:dind
|
||||
script:
|
||||
- curl --user admin:$JENKINS_PWD http://38.47.180.165:8080/job/auto-deploy-new-mediahub-fe/build?token=autodeploynewmediahub
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
FROM node:21-alpine
|
||||
|
||||
ENV PORT 3000
|
||||
|
||||
# Create app directory
|
||||
RUN mkdir -p /usr/src/app
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Installing dependencies
|
||||
COPY package*.json /usr/src/app/
|
||||
|
||||
# RUN npm install --force
|
||||
RUN npm install -g npm@latest
|
||||
RUN npm install next --legacy-peer-deps
|
||||
|
||||
# Copying source files
|
||||
COPY . /usr/src/app
|
||||
|
||||
# Building app
|
||||
RUN npm run build
|
||||
EXPOSE 3000
|
||||
|
||||
# Running the app
|
||||
CMD "npm" "run" "start"
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import React from "react";
|
||||
|
||||
const page = () => {
|
||||
return <div>ppp</div>;
|
||||
};
|
||||
|
||||
export default page;
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
"use client"
|
||||
"use client";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { useForm, Controller } from "react-hook-form";
|
||||
import { cn, } from "@/lib/utils";
|
||||
import { format } from "date-fns"
|
||||
import { cn } from "@/lib/utils";
|
||||
import { format } from "date-fns";
|
||||
import {
|
||||
Popover,
|
||||
PopoverContent,
|
||||
|
|
@ -24,23 +24,36 @@ import { z } from "zod";
|
|||
import { Loader2, CalendarIcon } from "lucide-react";
|
||||
import DeleteConfirmationDialog from "@/components/delete-confirmation-dialog";
|
||||
import { CalendarCategory } from "./data";
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
|
||||
const schema = z.object({
|
||||
title: z.string().min(3, { message: "Required" }),
|
||||
});
|
||||
|
||||
const EventModal = ({ open, onClose, categories, event, selectedDate }: {
|
||||
const EventModal = ({
|
||||
open,
|
||||
onClose,
|
||||
categories,
|
||||
event,
|
||||
selectedDate,
|
||||
}: {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
categories: any;
|
||||
event: any;
|
||||
selectedDate: any
|
||||
selectedDate: any;
|
||||
}) => {
|
||||
const [startDate, setStartDate] = useState<Date>(new Date());
|
||||
const [endDate, setEndDate] = useState<Date>(new Date());
|
||||
const [isPending, startTransition] = React.useTransition();
|
||||
const [calendarProps, setCalendarProps] = React.useState<any>(categories[0].value);
|
||||
const [calendarProps, setCalendarProps] = React.useState<any>(
|
||||
categories[0].value
|
||||
);
|
||||
// delete modal state
|
||||
const [deleteModalOpen, setDeleteModalOpen] = useState<boolean>(false);
|
||||
const [eventIdToDelete, setEventIdToDelete] = useState<string | null>(null);
|
||||
|
|
@ -58,7 +71,7 @@ const EventModal = ({ open, onClose, categories, event, selectedDate }: {
|
|||
});
|
||||
|
||||
const onSubmit = (data: any) => {
|
||||
startTransition(async () => {
|
||||
startTransition(() => {
|
||||
if (!event) {
|
||||
data.start = startDate;
|
||||
data.end = endDate;
|
||||
|
|
@ -91,10 +104,7 @@ const EventModal = ({ open, onClose, categories, event, selectedDate }: {
|
|||
|
||||
const onDeleteEventAction = async () => {
|
||||
try {
|
||||
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
const handleOpenDeleteModal = (eventId: string) => {
|
||||
|
|
@ -112,9 +122,7 @@ const EventModal = ({ open, onClose, categories, event, selectedDate }: {
|
|||
defaultToast={false}
|
||||
/>
|
||||
<Dialog open={open} onOpenChange={onClose}>
|
||||
<DialogContent
|
||||
onPointerDownOutside={onClose}
|
||||
>
|
||||
<DialogContent onPointerDownOutside={onClose}>
|
||||
<DialogHeader>
|
||||
<DialogTitle>
|
||||
{event ? "Edit Event" : "Create Event"} {event?.title}
|
||||
|
|
@ -133,7 +141,7 @@ const EventModal = ({ open, onClose, categories, event, selectedDate }: {
|
|||
/>
|
||||
{errors?.title?.message && (
|
||||
<div className="text-destructive text-sm">
|
||||
{typeof errors?.title?.message === 'string'
|
||||
{typeof errors?.title?.message === "string"
|
||||
? errors?.title?.message
|
||||
: JSON.stringify(errors?.title?.message)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
"use client"
|
||||
"use client";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { useForm, Controller } from "react-hook-form";
|
||||
import { cn, } from "@/lib/utils";
|
||||
import { format } from "date-fns"
|
||||
import { cn } from "@/lib/utils";
|
||||
import { format } from "date-fns";
|
||||
import {
|
||||
Popover,
|
||||
PopoverContent,
|
||||
|
|
@ -24,23 +24,36 @@ import { z } from "zod";
|
|||
import { Loader2, CalendarIcon } from "lucide-react";
|
||||
import DeleteConfirmationDialog from "@/components/delete-confirmation-dialog";
|
||||
import { CalendarCategory } from "./data";
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
|
||||
const schema = z.object({
|
||||
title: z.string().min(3, { message: "Required" }),
|
||||
});
|
||||
|
||||
const EventModal = ({ open, onClose, categories, event, selectedDate }: {
|
||||
const EventModal = ({
|
||||
open,
|
||||
onClose,
|
||||
categories,
|
||||
event,
|
||||
selectedDate,
|
||||
}: {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
categories: any;
|
||||
event: any;
|
||||
selectedDate: any
|
||||
selectedDate: any;
|
||||
}) => {
|
||||
const [startDate, setStartDate] = useState<Date>(new Date());
|
||||
const [endDate, setEndDate] = useState<Date>(new Date());
|
||||
const [isPending, startTransition] = React.useTransition();
|
||||
const [calendarProps, setCalendarProps] = React.useState<any>(categories[0].value);
|
||||
const [calendarProps, setCalendarProps] = React.useState<any>(
|
||||
categories[0].value
|
||||
);
|
||||
// delete modal state
|
||||
const [deleteModalOpen, setDeleteModalOpen] = useState<boolean>(false);
|
||||
const [eventIdToDelete, setEventIdToDelete] = useState<string | null>(null);
|
||||
|
|
@ -58,7 +71,7 @@ const EventModal = ({ open, onClose, categories, event, selectedDate }: {
|
|||
});
|
||||
|
||||
const onSubmit = (data: any) => {
|
||||
startTransition(async () => {
|
||||
startTransition(() => {
|
||||
if (!event) {
|
||||
data.start = startDate;
|
||||
data.end = endDate;
|
||||
|
|
@ -91,10 +104,7 @@ const EventModal = ({ open, onClose, categories, event, selectedDate }: {
|
|||
|
||||
const onDeleteEventAction = async () => {
|
||||
try {
|
||||
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
const handleOpenDeleteModal = (eventId: string) => {
|
||||
|
|
@ -112,9 +122,7 @@ const EventModal = ({ open, onClose, categories, event, selectedDate }: {
|
|||
defaultToast={false}
|
||||
/>
|
||||
<Dialog open={open} onOpenChange={onClose}>
|
||||
<DialogContent
|
||||
onPointerDownOutside={onClose}
|
||||
>
|
||||
<DialogContent onPointerDownOutside={onClose}>
|
||||
<DialogHeader>
|
||||
<DialogTitle>
|
||||
{event ? "Edit Event" : "Create Event"} {event?.title}
|
||||
|
|
@ -133,7 +141,7 @@ const EventModal = ({ open, onClose, categories, event, selectedDate }: {
|
|||
/>
|
||||
{errors?.title?.message && (
|
||||
<div className="text-destructive text-sm">
|
||||
{typeof errors?.title?.message === 'string'
|
||||
{typeof errors?.title?.message === "string"
|
||||
? errors?.title?.message
|
||||
: JSON.stringify(errors?.title?.message)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import MediahubTable from "../planning/mediahub/table-mediahub/mediahub-table";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { UploadIcon } from "lucide-react";
|
||||
import BlogTable from "./table/blog-table";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import MediahubTable from "../planning/mediahub/table-mediahub/mediahub-table";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { UploadIcon } from "lucide-react";
|
||||
import BlogTable from "./table/blog-table";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import MediahubTable from "../planning/mediahub/table-mediahub/mediahub-table";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { UploadIcon } from "lucide-react";
|
||||
import BlogTable from "./table/blog-table";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import MediahubTable from "../planning/mediahub/table-mediahub/mediahub-table";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { UploadIcon } from "lucide-react";
|
||||
import BlogTable from "./table/blog-table";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import MediahubTable from "../planning/mediahub/table-mediahub/mediahub-table";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { UploadIcon } from "lucide-react";
|
||||
import BlogTable from "./table/blog-table";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import MediahubTable from "../planning/mediahub/table-mediahub/mediahub-table";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { UploadIcon } from "lucide-react";
|
||||
import BlogTable from "./table/blog-table";
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
"use client";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||
import TableImage from "./table-spit";
|
||||
import TableImage from "./table-spit/page";
|
||||
import { Newspaper, NewspaperIcon, UploadIcon } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Icon } from "@iconify/react/dist/iconify.js";
|
||||
import TableSPIT from "./table-spit";
|
||||
import TableSPIT from "./table-spit/page";
|
||||
|
||||
const ReactTableSPITPage = () => {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
import {
|
||||
ColumnDef,
|
||||
|
|
@ -25,8 +24,6 @@ import {
|
|||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
|
||||
import { data } from "./data";
|
||||
import TablePagination from "./table-pagination";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { format } from "date-fns";
|
||||
import {
|
||||
|
|
@ -45,12 +42,7 @@ import {
|
|||
import { title } from "process";
|
||||
|
||||
import { getCookiesDecrypt } from "@/lib/utils";
|
||||
import {
|
||||
listDataAudio,
|
||||
listDataImage,
|
||||
listDataVideo,
|
||||
listSPIT,
|
||||
} from "@/service/content/content";
|
||||
import { listSPIT } from "@/service/content/content";
|
||||
import { pages } from "next/dist/build/templates/app-page";
|
||||
|
||||
export type CompanyData = {
|
||||
|
|
@ -65,7 +57,7 @@ export type CompanyData = {
|
|||
isDone: string;
|
||||
};
|
||||
|
||||
export const columns: ColumnDef<CompanyData>[] = [
|
||||
const columns: ColumnDef<CompanyData>[] = [
|
||||
{
|
||||
accessorKey: "no",
|
||||
header: "No",
|
||||
|
|
@ -251,46 +243,46 @@ const TableSPIT = () => {
|
|||
},
|
||||
});
|
||||
|
||||
React.useEffect(() => {
|
||||
initState();
|
||||
}, [page, limit]);
|
||||
// React.useEffect(() => {
|
||||
// initState();
|
||||
// }, [page, limit]);
|
||||
|
||||
async function initState() {
|
||||
try {
|
||||
const isForSelf = Number(roleId) == 4;
|
||||
// async function initState() {
|
||||
// try {
|
||||
// const isForSelf = Number(roleId) == 4;
|
||||
|
||||
let isPublish;
|
||||
if (statusFilter.length > 1) {
|
||||
isPublish = "";
|
||||
} else if (statusFilter.length === 1) {
|
||||
if (statusFilter.includes(1)) {
|
||||
isPublish = false;
|
||||
} else {
|
||||
isPublish = true;
|
||||
}
|
||||
} else {
|
||||
isPublish = undefined;
|
||||
}
|
||||
const res = await listSPIT(pages, limit, search, isPublish);
|
||||
const data = res.data.data.content.map((item: any, index: number) => ({
|
||||
no: (page - 1) * limit + index + 1,
|
||||
title: item.title,
|
||||
categoryName: item.categoryName,
|
||||
creatorGroup: item.creatorGroup,
|
||||
assignmentType: item.assignmentType?.name || "-",
|
||||
createdAt: item.createdAt,
|
||||
isDone: item.isDone,
|
||||
publishedOn: item.publishedOn,
|
||||
isPublish: item.isPublish,
|
||||
isPublishOnPolda: item.isPublishOnPolda,
|
||||
}));
|
||||
// let isPublish;
|
||||
// if (statusFilter.length > 1) {
|
||||
// isPublish = "";
|
||||
// } else if (statusFilter.length === 1) {
|
||||
// if (statusFilter.includes(1)) {
|
||||
// isPublish = false;
|
||||
// } else {
|
||||
// isPublish = true;
|
||||
// }
|
||||
// } else {
|
||||
// isPublish = undefined;
|
||||
// }
|
||||
// const res = await listSPIT(pages, limit, search, isPublish);
|
||||
// const data = res.data.data.content.map((item: any, index: number) => ({
|
||||
// no: (page - 1) * limit + index + 1,
|
||||
// title: item.title,
|
||||
// categoryName: item.categoryName,
|
||||
// creatorGroup: item.creatorGroup,
|
||||
// assignmentType: item.assignmentType?.name || "-",
|
||||
// createdAt: item.createdAt,
|
||||
// isDone: item.isDone,
|
||||
// publishedOn: item.publishedOn,
|
||||
// isPublish: item.isPublish,
|
||||
// isPublishOnPolda: item.isPublishOnPolda,
|
||||
// }));
|
||||
|
||||
setSpitTable(data);
|
||||
setTotalPage(res.data.totalPages);
|
||||
} catch (error) {
|
||||
console.error("Error fetching tasks:", error);
|
||||
}
|
||||
}
|
||||
// setSpitTable(data);
|
||||
// setTotalPage(res.data.totalPages);
|
||||
// } catch (error) {
|
||||
// console.error("Error fetching tasks:", error);
|
||||
// }
|
||||
// }
|
||||
|
||||
return (
|
||||
<div className="w-full">
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
"use client"
|
||||
"use client";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import world from "./world-map.json";
|
||||
// import world from "./world-map.json";
|
||||
import { VectorMap } from "@south-paw/react-vector-maps";
|
||||
import { useState } from "react";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
|
@ -39,7 +39,6 @@ const sales = [
|
|||
},
|
||||
];
|
||||
|
||||
|
||||
const MostSales = () => {
|
||||
const [filterMap, setFilterMap] = useState("usa");
|
||||
const t = useTranslations("AnalyticsDashboard");
|
||||
|
|
@ -63,7 +62,10 @@ const MostSales = () => {
|
|||
<span
|
||||
className={cn(
|
||||
"flex-1 text-sm font-normal px-3 py-1 transition-all duration-150 rounded cursor-pointer",
|
||||
{ "bg-default-900 text-primary-foreground dark:bg-default-300 dark:text-foreground ": filterMap === "usa" }
|
||||
{
|
||||
"bg-default-900 text-primary-foreground dark:bg-default-300 dark:text-foreground ":
|
||||
filterMap === "usa",
|
||||
}
|
||||
)}
|
||||
onClick={() => setFilterMap("usa")}
|
||||
>
|
||||
|
|
@ -111,7 +113,7 @@ const MostSales = () => {
|
|||
</ul>
|
||||
</div>
|
||||
<div className="flex-1 ">
|
||||
<VectorMap {...world} className="dashcode-app-vmap" />
|
||||
{/* <VectorMap {...world} className="dashcode-app-vmap" /> */}
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import MediahubTable from "../planning/mediahub/table-mediahub/mediahub-table";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { UploadIcon } from "lucide-react";
|
||||
import BlogTable from "./table/blog-table";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import MediahubTable from "../planning/mediahub/table-mediahub/mediahub-table";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { UploadIcon } from "lucide-react";
|
||||
import BlogTable from "./table/blog-table";
|
||||
|
|
|
|||
|
|
@ -1,30 +1,26 @@
|
|||
import LayoutProvider from "@/providers/layout.provider";
|
||||
import LayoutContentProvider from "@/providers/content.provider";
|
||||
import DashCodeSidebar from '@/components/partials/sidebar'
|
||||
import DashCodeFooter from '@/components/partials/footer'
|
||||
import ThemeCustomize from '@/components/partials/customizer'
|
||||
import DashCodeHeader from '@/components/partials/header'
|
||||
import DashCodeSidebar from "@/components/partials/sidebar";
|
||||
import DashCodeFooter from "@/components/partials/footer";
|
||||
import ThemeCustomize from "@/components/partials/customizer";
|
||||
import DashCodeHeader from "@/components/partials/header";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { redirect } from "@/components/navigation";
|
||||
const layout = async ({ children }: { children: React.ReactNode }) => {
|
||||
const session = await auth();
|
||||
|
||||
if (!session) {
|
||||
redirect("/");
|
||||
}
|
||||
return (
|
||||
<LayoutProvider >
|
||||
<ThemeCustomize />
|
||||
<DashCodeHeader />
|
||||
<DashCodeSidebar />
|
||||
<LayoutContentProvider>
|
||||
{children}
|
||||
</LayoutContentProvider>
|
||||
<DashCodeFooter />
|
||||
</LayoutProvider>
|
||||
)
|
||||
|
||||
const session = await auth();
|
||||
|
||||
if (!session) {
|
||||
redirect("/");
|
||||
}
|
||||
return (
|
||||
<LayoutProvider>
|
||||
<ThemeCustomize />
|
||||
{/* <DashCodeHeader /> */}
|
||||
<DashCodeSidebar />
|
||||
<LayoutContentProvider>{children}</LayoutContentProvider>
|
||||
{/* <DashCodeFooter /> */}
|
||||
</LayoutProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export default layout;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ export type CompanyData = {
|
|||
import { data } from "./data";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||
import { listTask } from "@/service/ppid-categories-services";
|
||||
import page from "../page";
|
||||
import { getPlanningSentPagination } from "@/service/planning/planning";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import ThemeCustomize from "@/components/partials/customizer";
|
|||
import DashCodeHeader from "@/components/partials/header";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { redirect } from "@/components/navigation";
|
||||
import Navbar from "@/components/landing-page/navbar";
|
||||
import Footer from "@/components/landing-page/footer";
|
||||
import Footer from "@/components/landing-page/Footer";
|
||||
import Navbar from "@/components/landing-page/Navbar";
|
||||
|
||||
const layout = async ({ children }: { children: React.ReactNode }) => {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import ThemeCustomize from "@/components/partials/customizer";
|
|||
import DashCodeHeader from "@/components/partials/header";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { redirect } from "@/components/navigation";
|
||||
import Navbar from "@/components/landing-page/navbar";
|
||||
import Footer from "@/components/landing-page/footer";
|
||||
import Footer from "@/components/landing-page/Footer";
|
||||
import Navbar from "@/components/landing-page/Navbar";
|
||||
|
||||
const layout = async ({ children }: { children: React.ReactNode }) => {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import ThemeCustomize from "@/components/partials/customizer";
|
|||
import DashCodeHeader from "@/components/partials/header";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { redirect } from "@/components/navigation";
|
||||
import Navbar from "@/components/landing-page/navbar";
|
||||
import Footer from "@/components/landing-page/footer";
|
||||
import Footer from "@/components/landing-page/Footer";
|
||||
import Navbar from "@/components/landing-page/Navbar";
|
||||
|
||||
const layout = async ({ children }: { children: React.ReactNode }) => {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import ThemeCustomize from "@/components/partials/customizer";
|
|||
import DashCodeHeader from "@/components/partials/header";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { redirect } from "@/components/navigation";
|
||||
import Navbar from "@/components/landing-page/navbar";
|
||||
import Footer from "@/components/landing-page/footer";
|
||||
import Footer from "@/components/landing-page/Footer";
|
||||
import Navbar from "@/components/landing-page/Navbar";
|
||||
|
||||
const layout = async ({ children }: { children: React.ReactNode }) => {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import ThemeCustomize from "@/components/partials/customizer";
|
|||
import DashCodeHeader from "@/components/partials/header";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { redirect } from "@/components/navigation";
|
||||
import Navbar from "@/components/landing-page/navbar";
|
||||
import Footer from "@/components/landing-page/footer";
|
||||
import Footer from "@/components/landing-page/Footer";
|
||||
import Navbar from "@/components/landing-page/Navbar";
|
||||
|
||||
const layout = async ({ children }: { children: React.ReactNode }) => {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import ThemeCustomize from "@/components/partials/customizer";
|
|||
import DashCodeHeader from "@/components/partials/header";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { redirect } from "@/components/navigation";
|
||||
import Navbar from "@/components/landing-page/navbar";
|
||||
import Footer from "@/components/landing-page/footer";
|
||||
import Footer from "@/components/landing-page/Footer";
|
||||
import Navbar from "@/components/landing-page/Navbar";
|
||||
|
||||
const layout = async ({ children }: { children: React.ReactNode }) => {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import Hero from "@/components/landing-page/hero";
|
|||
import Footer from "@/components/landing-page/footer";
|
||||
import Division from "@/components/landing-page/division";
|
||||
|
||||
|
||||
const Home = ({ params: { locale } }: { params: { locale: string } }) => {
|
||||
return (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,12 @@ import {
|
|||
import { toast } from "react-hot-toast";
|
||||
import { Loader2 } from "lucide-react";
|
||||
|
||||
const DeleteConfirmationDialog = ({ open, onClose, onConfirm, defaultToast = true, toastMessage = "Successfully deleted",
|
||||
const DeleteConfirmationDialog = ({
|
||||
open,
|
||||
onClose,
|
||||
onConfirm,
|
||||
defaultToast = true,
|
||||
toastMessage = "Successfully deleted",
|
||||
}: {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
|
|
@ -22,12 +27,12 @@ const DeleteConfirmationDialog = ({ open, onClose, onConfirm, defaultToast = tru
|
|||
}) => {
|
||||
const [isPending, startTransition] = useTransition();
|
||||
|
||||
const handleConfirm = async () => {
|
||||
const handleConfirm = () => {
|
||||
if (!onConfirm) {
|
||||
onClose();
|
||||
return;
|
||||
}
|
||||
await onConfirm();
|
||||
onConfirm();
|
||||
|
||||
onClose();
|
||||
if (defaultToast) {
|
||||
|
|
|
|||
|
|
@ -10,17 +10,7 @@ import * as z from "zod";
|
|||
import Swal from "sweetalert2";
|
||||
import withReactContent from "sweetalert2-react-content";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
import JoditEditor from "jodit-react";
|
||||
import { type } from "os";
|
||||
import loading from "@/app/[locale]/(protected)/app/projects/loading";
|
||||
import { request } from "http";
|
||||
import { error } from "@/lib/utils";
|
||||
import { createTask } from "@/service/task";
|
||||
import { options } from "@fullcalendar/core/preact.js";
|
||||
import { setOptions } from "leaflet";
|
||||
import {
|
||||
getCuratorUser,
|
||||
getTicketingPriority,
|
||||
|
|
|
|||
|
|
@ -11,16 +11,7 @@ import Swal from "sweetalert2";
|
|||
import withReactContent from "sweetalert2-react-content";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
import JoditEditor from "jodit-react";
|
||||
import { type } from "os";
|
||||
import loading from "@/app/[locale]/(protected)/app/projects/loading";
|
||||
import { request } from "http";
|
||||
import { error } from "@/lib/utils";
|
||||
import { createTask } from "@/service/task";
|
||||
import { options } from "@fullcalendar/core/preact.js";
|
||||
import { setOptions } from "leaflet";
|
||||
import {
|
||||
getCuratorUser,
|
||||
getTicketingPriority,
|
||||
|
|
|
|||
|
|
@ -52,138 +52,135 @@ const LoginForm = () => {
|
|||
|
||||
// Fungsi submit form
|
||||
const onSubmit: SubmitHandler<LoginFormValues> = async (data) => {
|
||||
startTransition(async () => {
|
||||
try {
|
||||
const response = await setLogin({
|
||||
...data,
|
||||
grant_type: "password",
|
||||
client_id: "mediahub-app",
|
||||
try {
|
||||
const response = await setLogin({
|
||||
...data,
|
||||
grant_type: "password",
|
||||
client_id: "mediahub-app",
|
||||
});
|
||||
|
||||
if (response.error) {
|
||||
toast.error("Username / Password Tidak Sesuai");
|
||||
} else {
|
||||
const { access_token } = response.data;
|
||||
const { refresh_token } = response.data;
|
||||
const dateTime = new Date();
|
||||
const newTime = dateTime.getTime() + 10 * 60 * 1000;
|
||||
|
||||
Cookies.set("access_token", access_token, {
|
||||
expires: 1,
|
||||
});
|
||||
Cookies.set("refresh_token", refresh_token, {
|
||||
expires: 1,
|
||||
});
|
||||
Cookies.set("time_refresh", new Date(newTime).toISOString(), {
|
||||
expires: 1,
|
||||
});
|
||||
|
||||
if (response.error) {
|
||||
toast.error("Username / Password Tidak Sesuai");
|
||||
Cookies.set("is_first_login", String(true), {
|
||||
secure: true,
|
||||
sameSite: "strict",
|
||||
});
|
||||
const profile = await getProfile(access_token);
|
||||
console.log("PROFILE : ", profile?.data?.data);
|
||||
|
||||
if (
|
||||
profile?.data?.data?.isInternational == true ||
|
||||
profile?.data?.data?.isActive == false ||
|
||||
profile?.data?.data?.isDelete == true
|
||||
) {
|
||||
Object.keys(Cookies.get()).forEach((cookieName) => {
|
||||
Cookies.remove(cookieName);
|
||||
});
|
||||
warning(
|
||||
"Akun Anda tidak dapat digunakan untuk masuk ke MediaHub Polri",
|
||||
"/auth/login"
|
||||
);
|
||||
} else {
|
||||
const { access_token } = response.data;
|
||||
const { refresh_token } = response.data;
|
||||
const dateTime = new Date();
|
||||
const newTime = dateTime.getTime() + 10 * 60 * 1000;
|
||||
|
||||
Cookies.set("access_token", access_token, {
|
||||
Cookies.set("home_path", profile.data?.data?.homePath, {
|
||||
expires: 1,
|
||||
});
|
||||
Cookies.set("refresh_token", refresh_token, {
|
||||
Cookies.set(
|
||||
"profile_picture",
|
||||
profile.data?.data?.profilePictureUrl,
|
||||
{
|
||||
expires: 1,
|
||||
}
|
||||
);
|
||||
Cookies.set("state", profile.data?.data?.userLevel?.name, {
|
||||
expires: 1,
|
||||
});
|
||||
Cookies.set("time_refresh", new Date(newTime).toISOString(), {
|
||||
setCookiesEncrypt("uie", profile.data.data?.id, {
|
||||
expires: 1,
|
||||
});
|
||||
|
||||
Cookies.set("is_first_login", String(true), {
|
||||
secure: true,
|
||||
sameSite: "strict",
|
||||
setCookiesEncrypt("urie", profile.data.data?.roleId, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt("urne", profile.data.data?.role?.name, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt("ulie", profile.data.data?.userLevel?.id, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt(
|
||||
"ulplie",
|
||||
profile.data.data?.userLevel?.parentLevelId,
|
||||
{
|
||||
expires: 1,
|
||||
}
|
||||
);
|
||||
setCookiesEncrypt("ulne", profile.data.data?.userLevel?.levelNumber, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt("ufne", profile.data.data?.fullname, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt("ulnae", profile.data.data?.userLevel?.name, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt("uinse", profile.data.data?.instituteId, {
|
||||
expires: 1,
|
||||
});
|
||||
const profile = await getProfile(access_token);
|
||||
console.log("PROFILE : ", profile?.data?.data);
|
||||
|
||||
if (
|
||||
profile?.data?.data?.isInternational == true ||
|
||||
profile?.data?.data?.isActive == false ||
|
||||
profile?.data?.data?.isDelete == true
|
||||
Number(profile.data.data?.roleId) == 2 ||
|
||||
Number(profile.data.data?.roleId) == 3 ||
|
||||
Number(profile.data.data?.roleId) == 4 ||
|
||||
Number(profile.data.data?.roleId) == 9 ||
|
||||
Number(profile.data.data?.roleId) == 10 ||
|
||||
Number(profile.data.data?.roleId) == 11 ||
|
||||
Number(profile.data.data?.roleId) == 12
|
||||
) {
|
||||
Object.keys(Cookies.get()).forEach((cookieName) => {
|
||||
Cookies.remove(cookieName);
|
||||
});
|
||||
warning(
|
||||
"Akun Anda tidak dapat digunakan untuk masuk ke MediaHub Polri",
|
||||
"/auth/login"
|
||||
);
|
||||
} else {
|
||||
Cookies.set("home_path", profile.data?.data?.homePath, {
|
||||
expires: 1,
|
||||
});
|
||||
Cookies.set(
|
||||
"profile_picture",
|
||||
profile.data?.data?.profilePictureUrl,
|
||||
{
|
||||
expires: 1,
|
||||
}
|
||||
);
|
||||
Cookies.set("state", profile.data?.data?.userLevel?.name, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt("uie", profile.data.data?.id, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt("urie", profile.data.data?.roleId, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt("urne", profile.data.data?.role?.name, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt("ulie", profile.data.data?.userLevel?.id, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt(
|
||||
"ulplie",
|
||||
profile.data.data?.userLevel?.parentLevelId,
|
||||
{
|
||||
expires: 1,
|
||||
}
|
||||
);
|
||||
setCookiesEncrypt(
|
||||
"ulne",
|
||||
profile.data.data?.userLevel?.levelNumber,
|
||||
{
|
||||
expires: 1,
|
||||
}
|
||||
);
|
||||
setCookiesEncrypt("ufne", profile.data.data?.fullname, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt("ulnae", profile.data.data?.userLevel?.name, {
|
||||
expires: 1,
|
||||
});
|
||||
setCookiesEncrypt("uinse", profile.data.data?.instituteId, {
|
||||
expires: 1,
|
||||
});
|
||||
|
||||
if (
|
||||
Number(profile.data.data?.roleId) == 2 ||
|
||||
Number(profile.data.data?.roleId) == 3 ||
|
||||
Number(profile.data.data?.roleId) == 4 ||
|
||||
Number(profile.data.data?.roleId) == 9 ||
|
||||
Number(profile.data.data?.roleId) == 10 ||
|
||||
Number(profile.data.data?.roleId) == 11 ||
|
||||
Number(profile.data.data?.roleId) == 12
|
||||
profile.data.data?.userLevel?.id == 761 ||
|
||||
profile.data.data?.userLevel?.parentLevelId == 761
|
||||
) {
|
||||
if (
|
||||
profile.data.data?.userLevel?.id == 761 ||
|
||||
profile.data.data?.userLevel?.parentLevelId == 761
|
||||
) {
|
||||
window.location.href = "/admin/welcome";
|
||||
// router.push('/admin/dashboard');
|
||||
Cookies.set("status", "login", {
|
||||
expires: 1,
|
||||
});
|
||||
} else {
|
||||
window.location.href = "/en/dashboard";
|
||||
// router.push('/admin/dashboard');
|
||||
Cookies.set("status", "login", {
|
||||
expires: 1,
|
||||
});
|
||||
}
|
||||
window.location.href = "/admin/welcome";
|
||||
// router.push('/admin/dashboard');
|
||||
Cookies.set("status", "login", {
|
||||
expires: 1,
|
||||
});
|
||||
} else {
|
||||
window.location.href = "/";
|
||||
window.location.href = "/en/dashboard";
|
||||
// router.push('/admin/dashboard');
|
||||
Cookies.set("status", "login", {
|
||||
expires: 1,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
window.location.href = "/";
|
||||
Cookies.set("status", "login", {
|
||||
expires: 1,
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (err: any) {
|
||||
toast.error(err.message || "An unexpected error occurred.");
|
||||
}
|
||||
});
|
||||
} catch (err: any) {
|
||||
toast.error(err.message || "An unexpected error occurred.");
|
||||
}
|
||||
// startTransition( () => {
|
||||
|
||||
// });
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -10,7 +10,13 @@ const Social = ({ locale }: { locale: string }) => {
|
|||
href="#"
|
||||
className="inline-flex h-10 w-10 p-2 bg-[#1C9CEB] text-white text-2xl flex-col items-center justify-center rounded-full"
|
||||
>
|
||||
<Image width={300} height={300} className="w-full h-full" src="/images/icon/tw.svg" alt="" />
|
||||
<Image
|
||||
width={300}
|
||||
height={300}
|
||||
className="w-full h-full"
|
||||
src="/images/icon/tw.svg"
|
||||
alt=""
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
<li className="flex-1">
|
||||
|
|
@ -18,7 +24,13 @@ const Social = ({ locale }: { locale: string }) => {
|
|||
href="#"
|
||||
className="inline-flex h-10 w-10 p-2 bg-[#395599] text-white text-2xl flex-col items-center justify-center rounded-full"
|
||||
>
|
||||
<Image width={300} height={300} className="w-full h-full" src="/images/icon/fb.svg" alt="" />
|
||||
<Image
|
||||
width={300}
|
||||
height={300}
|
||||
className="w-full h-full"
|
||||
src="/images/icon/fb.svg"
|
||||
alt=""
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
<li className="flex-1">
|
||||
|
|
@ -26,22 +38,36 @@ const Social = ({ locale }: { locale: string }) => {
|
|||
href="#"
|
||||
className="inline-flex h-10 w-10 p-2 bg-[#0A63BC] text-white text-2xl flex-col items-center justify-center rounded-full"
|
||||
>
|
||||
<Image width={300} height={300} className="w-full h-full" src="/images/icon/in.svg" alt="" />
|
||||
<Image
|
||||
width={300}
|
||||
height={300}
|
||||
className="w-full h-full"
|
||||
src="/images/icon/in.svg"
|
||||
alt=""
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
<li className="flex-1">
|
||||
<form
|
||||
action={async () => {
|
||||
"use server";
|
||||
await signIn("google", { redirectTo: `/${locale}/dashboard/analytics` });
|
||||
}}
|
||||
// action={async () => {
|
||||
// "use server";
|
||||
// await signIn("google", { redirectTo: `/${locale}/dashboard/analytics` });
|
||||
// }}
|
||||
>
|
||||
<button type="submit" className="inline-flex h-10 w-10 p-2 bg-[#EA4335] text-white text-2xl flex-col items-center justify-center rounded-full">
|
||||
<Image width={300} height={300} className="w-full h-full" src="/images/icon/gp.svg" alt="" />
|
||||
<button
|
||||
type="submit"
|
||||
className="inline-flex h-10 w-10 p-2 bg-[#EA4335] text-white text-2xl flex-col items-center justify-center rounded-full"
|
||||
>
|
||||
<Image
|
||||
width={300}
|
||||
height={300}
|
||||
className="w-full h-full"
|
||||
src="/images/icon/gp.svg"
|
||||
alt=""
|
||||
/>
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,42 +1,39 @@
|
|||
import React from 'react'
|
||||
import HeaderContent from './header-content'
|
||||
import HeaderSearch from './header-search'
|
||||
import ProfileInfo from './profile-info'
|
||||
import Notifications from './notifications'
|
||||
import Messages from "./messages"
|
||||
import { Cart } from './cart'
|
||||
import ThemeSwitcher from './theme-switcher'
|
||||
import { SidebarToggle } from '@/components/partials/sidebar/sidebar-toggle'
|
||||
import { SheetMenu } from '@/components/partials/sidebar/menu/sheet-menu'
|
||||
import HorizontalMenu from "./horizontal-menu"
|
||||
import LocalSwitcher from './locale-switcher'
|
||||
import HeaderLogo from "./header-logo"
|
||||
|
||||
import React from "react";
|
||||
import HeaderContent from "./header-content";
|
||||
import HeaderSearch from "./header-search";
|
||||
import ProfileInfo from "./profile-info";
|
||||
import Notifications from "./notifications";
|
||||
import Messages from "./messages";
|
||||
import { Cart } from "./cart";
|
||||
import ThemeSwitcher from "./theme-switcher";
|
||||
import { SidebarToggle } from "@/components/partials/sidebar/sidebar-toggle";
|
||||
import { SheetMenu } from "@/components/partials/sidebar/menu/sheet-menu";
|
||||
import HorizontalMenu from "./horizontal-menu";
|
||||
import LocalSwitcher from "./locale-switcher";
|
||||
import HeaderLogo from "./header-logo";
|
||||
|
||||
const DashCodeHeader = async () => {
|
||||
return (
|
||||
<>
|
||||
<HeaderContent>
|
||||
<div className=" flex gap-3 items-center">
|
||||
<HeaderLogo />
|
||||
<SidebarToggle />
|
||||
<HeaderSearch />
|
||||
</div>
|
||||
<div className="nav-tools flex items-center md:gap-4 gap-3">
|
||||
<LocalSwitcher />
|
||||
<ThemeSwitcher />
|
||||
<Cart />
|
||||
<Messages />
|
||||
<Notifications />
|
||||
{/* <ProfileInfo /> */}
|
||||
<SheetMenu />
|
||||
</div>
|
||||
</HeaderContent>
|
||||
<HorizontalMenu />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<HeaderContent>
|
||||
<div className=' flex gap-3 items-center'>
|
||||
<HeaderLogo />
|
||||
<SidebarToggle />
|
||||
<HeaderSearch />
|
||||
</div>
|
||||
<div className="nav-tools flex items-center md:gap-4 gap-3">
|
||||
<LocalSwitcher />
|
||||
<ThemeSwitcher />
|
||||
<Cart />
|
||||
<Messages />
|
||||
<Notifications />
|
||||
<ProfileInfo />
|
||||
<SheetMenu />
|
||||
</div>
|
||||
</HeaderContent>
|
||||
<HorizontalMenu />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default DashCodeHeader
|
||||
export default DashCodeHeader;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
|
|
@ -12,23 +11,20 @@ import {
|
|||
DropdownMenuSubTrigger,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { Icon } from "@/components/ui/icon"
|
||||
import { Icon } from "@/components/ui/icon";
|
||||
import { signOut, auth } from "@/lib/auth";
|
||||
import Image from "next/image";
|
||||
import { Link } from '@/i18n/routing';
|
||||
import { Link } from "@/i18n/routing";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
const ProfileInfo = async () => {
|
||||
const session = await auth();
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="md:block hidden">
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild className=" cursor-pointer">
|
||||
<div className=" flex items-center gap-3 text-default-800 ">
|
||||
|
||||
<Image
|
||||
src={session?.user?.image as string}
|
||||
alt={session?.user?.name?.charAt(0) as string}
|
||||
|
|
@ -47,7 +43,6 @@ const ProfileInfo = async () => {
|
|||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent className="w-56 p-0" align="end">
|
||||
<DropdownMenuLabel className="flex gap-2 items-center mb-1 p-3">
|
||||
|
||||
<Image
|
||||
src={session?.user?.image as string}
|
||||
alt={session?.user?.name?.charAt(0) as string}
|
||||
|
|
@ -73,22 +68,22 @@ const ProfileInfo = async () => {
|
|||
{
|
||||
name: "profile",
|
||||
icon: "heroicons:user",
|
||||
href: "/user-profile"
|
||||
href: "/user-profile",
|
||||
},
|
||||
{
|
||||
name: "Billing",
|
||||
icon: "heroicons:megaphone",
|
||||
href: "/dashboard"
|
||||
href: "/dashboard",
|
||||
},
|
||||
{
|
||||
name: "Settings",
|
||||
icon: "heroicons:paper-airplane",
|
||||
href: "/dashboard"
|
||||
href: "/dashboard",
|
||||
},
|
||||
{
|
||||
name: "Keyboard shortcuts",
|
||||
icon: "heroicons:language",
|
||||
href: "/dashboard"
|
||||
href: "/dashboard",
|
||||
},
|
||||
].map((item, index) => (
|
||||
<Link
|
||||
|
|
@ -178,19 +173,18 @@ const ProfileInfo = async () => {
|
|||
</DropdownMenuSub>
|
||||
</DropdownMenuGroup>
|
||||
<DropdownMenuSeparator className="mb-0 dark:bg-background" />
|
||||
<DropdownMenuItem
|
||||
|
||||
className="flex items-center gap-2 text-sm font-medium text-default-600 capitalize my-1 px-3 cursor-pointer"
|
||||
>
|
||||
|
||||
<DropdownMenuItem className="flex items-center gap-2 text-sm font-medium text-default-600 capitalize my-1 px-3 cursor-pointer">
|
||||
<div>
|
||||
<form
|
||||
action={async () => {
|
||||
"use server";
|
||||
await signOut();
|
||||
}}
|
||||
// action={async () => {
|
||||
// "use server";
|
||||
// await signOut();
|
||||
// }}
|
||||
>
|
||||
<button type="submit" className=" w-full flex items-center gap-2" >
|
||||
<button
|
||||
type="submit"
|
||||
className=" w-full flex items-center gap-2"
|
||||
>
|
||||
<Icon icon="heroicons:power" className="w-4 h-4" />
|
||||
Log out
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -298,9 +298,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@babel/traverse": {
|
||||
"version": "7.26.3",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.3.tgz",
|
||||
"integrity": "sha512-yTmc8J+Sj8yLzwr4PD5Xb/WF3bOYu2C2OoSZPzbuqRm4n98XirsbzaX+GloeO376UnSYIYJ4NCanwV5/ugZkwA==",
|
||||
"version": "7.26.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.4.tgz",
|
||||
"integrity": "sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.26.2",
|
||||
"@babel/generator": "^7.26.3",
|
||||
|
|
@ -360,9 +360,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@dnd-kit/core": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.0.tgz",
|
||||
"integrity": "sha512-1PZxmnH+hQFwcaVRCe4SrtBn4cZ9S0trGtxHE13iLGEEZFhiFe+Sxg4ZUlwirYsXJCejqUYDi85PQC7J8/AINg==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz",
|
||||
"integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==",
|
||||
"dependencies": {
|
||||
"@dnd-kit/accessibility": "^3.1.1",
|
||||
"@dnd-kit/utilities": "^3.2.2",
|
||||
|
|
@ -465,9 +465,9 @@
|
|||
"integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw=="
|
||||
},
|
||||
"node_modules/@emotion/cache": {
|
||||
"version": "11.13.5",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.13.5.tgz",
|
||||
"integrity": "sha512-Z3xbtJ+UcK76eWkagZ1onvn/wAVb1GOMuR15s30Fm2wrMgC7jzpnO2JZXr4eujTTqoQFUrZIw/rT0c6Zzjca1g==",
|
||||
"version": "11.14.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.14.0.tgz",
|
||||
"integrity": "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA==",
|
||||
"dependencies": {
|
||||
"@emotion/memoize": "^0.9.0",
|
||||
"@emotion/sheet": "^1.4.0",
|
||||
|
|
@ -492,15 +492,15 @@
|
|||
"integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ=="
|
||||
},
|
||||
"node_modules/@emotion/react": {
|
||||
"version": "11.13.5",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.13.5.tgz",
|
||||
"integrity": "sha512-6zeCUxUH+EPF1s+YF/2hPVODeV/7V07YU5x+2tfuRL8MdW6rv5vb2+CBEGTGwBdux0OIERcOS+RzxeK80k2DsQ==",
|
||||
"version": "11.14.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.14.0.tgz",
|
||||
"integrity": "sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@emotion/babel-plugin": "^11.13.5",
|
||||
"@emotion/cache": "^11.13.5",
|
||||
"@emotion/cache": "^11.14.0",
|
||||
"@emotion/serialize": "^1.3.3",
|
||||
"@emotion/use-insertion-effect-with-fallbacks": "^1.1.0",
|
||||
"@emotion/use-insertion-effect-with-fallbacks": "^1.2.0",
|
||||
"@emotion/utils": "^1.4.2",
|
||||
"@emotion/weak-memoize": "^0.4.0",
|
||||
"hoist-non-react-statics": "^3.3.1"
|
||||
|
|
@ -537,9 +537,9 @@
|
|||
"integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg=="
|
||||
},
|
||||
"node_modules/@emotion/use-insertion-effect-with-fallbacks": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.1.0.tgz",
|
||||
"integrity": "sha512-+wBOcIV5snwGgI2ya3u99D7/FJquOIniQT1IKyDsBmEgwvpxMNeS65Oib7OnE2d2aY+3BU4OiH+0Wchf8yk3Hw==",
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.2.0.tgz",
|
||||
"integrity": "sha512-yJMtVdH59sxi/aVJBpk9FQq+OR8ll5GT8oWd57UpeaKEVGab41JWaCFA7FRLoMLloOZF/c/wsPoe+bfGmRKgDg==",
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.0"
|
||||
}
|
||||
|
|
@ -678,46 +678,47 @@
|
|||
"integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig=="
|
||||
},
|
||||
"node_modules/@formatjs/ecma402-abstract": {
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.2.4.tgz",
|
||||
"integrity": "sha512-lFyiQDVvSbQOpU+WFd//ILolGj4UgA/qXrKeZxdV14uKiAUiPAtX6XAn7WBCRi7Mx6I7EybM9E5yYn4BIpZWYg==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.3.1.tgz",
|
||||
"integrity": "sha512-Ip9uV+/MpLXWRk03U/GzeJMuPeOXpJBSB5V1tjA6kJhvqssye5J5LoYLc7Z5IAHb7nR62sRoguzrFiVCP/hnzw==",
|
||||
"dependencies": {
|
||||
"@formatjs/fast-memoize": "2.2.3",
|
||||
"@formatjs/intl-localematcher": "0.5.8",
|
||||
"@formatjs/fast-memoize": "2.2.5",
|
||||
"@formatjs/intl-localematcher": "0.5.9",
|
||||
"decimal.js": "10",
|
||||
"tslib": "2"
|
||||
}
|
||||
},
|
||||
"node_modules/@formatjs/fast-memoize": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.2.3.tgz",
|
||||
"integrity": "sha512-3jeJ+HyOfu8osl3GNSL4vVHUuWFXR03Iz9jjgI7RwjG6ysu/Ymdr0JRCPHfF5yGbTE6JCrd63EpvX1/WybYRbA==",
|
||||
"version": "2.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.2.5.tgz",
|
||||
"integrity": "sha512-6PoewUMrrcqxSoBXAOJDiW1m+AmkrAj0RiXnOMD59GRaswjXhm3MDhgepXPBgonc09oSirAJTsAggzAGQf6A6g==",
|
||||
"dependencies": {
|
||||
"tslib": "2"
|
||||
}
|
||||
},
|
||||
"node_modules/@formatjs/icu-messageformat-parser": {
|
||||
"version": "2.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.9.4.tgz",
|
||||
"integrity": "sha512-Tbvp5a9IWuxUcpWNIW6GlMQYEc4rwNHR259uUFoKWNN1jM9obf9Ul0e+7r7MvFOBNcN+13K7NuKCKqQiAn1QEg==",
|
||||
"version": "2.9.7",
|
||||
"resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.9.7.tgz",
|
||||
"integrity": "sha512-cuEHyRM5VqLQobANOjtjlgU7+qmk9Q3fDQuBiRRJ3+Wp3ZoZhpUPtUfuimZXsir6SaI2TaAJ+SLo9vLnV5QcbA==",
|
||||
"dependencies": {
|
||||
"@formatjs/ecma402-abstract": "2.2.4",
|
||||
"@formatjs/icu-skeleton-parser": "1.8.8",
|
||||
"@formatjs/ecma402-abstract": "2.3.1",
|
||||
"@formatjs/icu-skeleton-parser": "1.8.11",
|
||||
"tslib": "2"
|
||||
}
|
||||
},
|
||||
"node_modules/@formatjs/icu-skeleton-parser": {
|
||||
"version": "1.8.8",
|
||||
"resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.8.tgz",
|
||||
"integrity": "sha512-vHwK3piXwamFcx5YQdCdJxUQ1WdTl6ANclt5xba5zLGDv5Bsur7qz8AD7BevaKxITwpgDeU0u8My3AIibW9ywA==",
|
||||
"version": "1.8.11",
|
||||
"resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.11.tgz",
|
||||
"integrity": "sha512-8LlHHE/yL/zVJZHAX3pbKaCjZKmBIO6aJY1mkVh4RMSEu/2WRZ4Ysvv3kKXJ9M8RJLBHdnk1/dUQFdod1Dt7Dw==",
|
||||
"dependencies": {
|
||||
"@formatjs/ecma402-abstract": "2.2.4",
|
||||
"@formatjs/ecma402-abstract": "2.3.1",
|
||||
"tslib": "2"
|
||||
}
|
||||
},
|
||||
"node_modules/@formatjs/intl-localematcher": {
|
||||
"version": "0.5.8",
|
||||
"resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.8.tgz",
|
||||
"integrity": "sha512-I+WDNWWJFZie+jkfkiK5Mp4hEDyRSEvmyfYadflOno/mmKJKcB17fEpEH0oJu/OWhhCJ8kJBDz2YMd/6cDl7Mg==",
|
||||
"version": "0.5.9",
|
||||
"resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.9.tgz",
|
||||
"integrity": "sha512-8zkGu/sv5euxbjfZ/xmklqLyDGQSxsLqg8XOq88JW3cmJtzhCP8EtSJXlaKZnVO4beEaoiT9wj4eIoCQ9smwxA==",
|
||||
"dependencies": {
|
||||
"tslib": "2"
|
||||
}
|
||||
|
|
@ -849,9 +850,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/@iconify/react": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@iconify/react/-/react-5.0.2.tgz",
|
||||
"integrity": "sha512-wtmstbYlEbo4NDxFxBJkhkf9gJBDqMGr7FaqLrAUMneRV3Z+fVHLJjOhWbkAF8xDQNFC/wcTYdrWo1lnRhmagQ==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@iconify/react/-/react-5.1.0.tgz",
|
||||
"integrity": "sha512-vj2wzalywy23DR37AnsogMPIkDa1nKEqITjxpH4z44tiLV869Mh7VyydD4/t0yJLEs9tsxlrPWtXvMOe1Lcd5g==",
|
||||
"dependencies": {
|
||||
"@iconify/types": "^2.0.0"
|
||||
},
|
||||
|
|
@ -1609,9 +1610,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@next/bundle-analyzer": {
|
||||
"version": "15.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/bundle-analyzer/-/bundle-analyzer-15.0.3.tgz",
|
||||
"integrity": "sha512-x7ZNvpoQPO0C5ZG//qVp21Qs3v6+C8LBJmdu9DKj4/NmjlnwoQ7dqRZ/nKZcwVhkFT7BHf+Qd5FaeHq9IDJvDQ==",
|
||||
"version": "15.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/bundle-analyzer/-/bundle-analyzer-15.0.4.tgz",
|
||||
"integrity": "sha512-0If3/mxqUWYC0lAdV5cChGA1Xs1BENjaLyJkdqpI2df86HqprcDZagiB2IU1xc5ph7xZHRdi5mT2cY7VkyibTQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"webpack-bundle-analyzer": "4.10.1"
|
||||
|
|
@ -3372,9 +3373,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@tanstack/react-virtual": {
|
||||
"version": "3.10.9",
|
||||
"resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.10.9.tgz",
|
||||
"integrity": "sha512-OXO2uBjFqA4Ibr2O3y0YMnkrRWGVNqcvHQXmGvMu6IK8chZl3PrDxFXdGZ2iZkSrKh3/qUYoFqYe+Rx23RoU0g==",
|
||||
"version": "3.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.11.1.tgz",
|
||||
"integrity": "sha512-orn2QNe5tF6SqjucHJ6cKTKcRDe3GG7bcYqPNn72Yejj7noECdzgAyRfGt2pGDPemhYim3d1HIR/dgruCnLfUA==",
|
||||
"dependencies": {
|
||||
"@tanstack/virtual-core": "3.10.9"
|
||||
},
|
||||
|
|
@ -3383,8 +3384,8 @@
|
|||
"url": "https://github.com/sponsors/tannerlinsley"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@tanstack/table-core": {
|
||||
|
|
@ -3549,9 +3550,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@types/geojson": {
|
||||
"version": "7946.0.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz",
|
||||
"integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==",
|
||||
"version": "7946.0.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.15.tgz",
|
||||
"integrity": "sha512-9oSxFzDCT2Rj6DfcHF8G++jxBKS7mBqXl5xrRW+Kbvjry6Uduya2iiwqHPhVXpasAVMBYKkEPGgKhd3+/HZ6xA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/google.maps": {
|
||||
|
|
@ -3662,9 +3663,9 @@
|
|||
"integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw=="
|
||||
},
|
||||
"node_modules/@types/prop-types": {
|
||||
"version": "15.7.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.13.tgz",
|
||||
"integrity": "sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA=="
|
||||
"version": "15.7.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.14.tgz",
|
||||
"integrity": "sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ=="
|
||||
},
|
||||
"node_modules/@types/qs": {
|
||||
"version": "6.9.17",
|
||||
|
|
@ -3672,9 +3673,9 @@
|
|||
"integrity": "sha512-rX4/bPcfmvxHDv0XjfJELTTr+iB+tn032nPILqHm5wbthUUUuVtNGGqzhya9XUxjTP8Fpr0qYgSZZKxGY++svQ=="
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
"version": "18.3.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.13.tgz",
|
||||
"integrity": "sha512-ii/gswMmOievxAJed4PAHT949bpYjPKXvXo1v6cRB/kqc2ZR4n+SgyCyvyc5Fec5ez8VnUumI1Vk7j6fRyRogg==",
|
||||
"version": "18.3.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.14.tgz",
|
||||
"integrity": "sha512-NzahNKvjNhVjuPBQ+2G7WlxstQ+47kXZNHlUvFakDViuIEfGY926GqhMueQFZ7woG+sPiQKlF36XfrIUVSUfFg==",
|
||||
"dependencies": {
|
||||
"@types/prop-types": "*",
|
||||
"csstype": "^3.0.2"
|
||||
|
|
@ -3873,9 +3874,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@ungap/structured-clone": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
|
||||
"integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ=="
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.1.tgz",
|
||||
"integrity": "sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA=="
|
||||
},
|
||||
"node_modules/@vercel/analytics": {
|
||||
"version": "1.4.1",
|
||||
|
|
@ -4391,15 +4392,14 @@
|
|||
}
|
||||
},
|
||||
"node_modules/call-bind": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz",
|
||||
"integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==",
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz",
|
||||
"integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.0",
|
||||
"es-define-property": "^1.0.0",
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-intrinsic": "^1.2.4",
|
||||
"set-function-length": "^1.2.1"
|
||||
"set-function-length": "^1.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
|
|
@ -4408,6 +4408,18 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz",
|
||||
"integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/callsites": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||
|
|
@ -4425,9 +4437,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001686",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001686.tgz",
|
||||
"integrity": "sha512-Y7deg0Aergpa24M3qLC5xjNklnKnhsmSyR/V89dLZ1n0ucJIFNs7PgR2Yfa/Zf6W79SbBicgtGxZr2juHkEUIA==",
|
||||
"version": "1.0.30001687",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001687.tgz",
|
||||
"integrity": "sha512-0S/FDhf4ZiqrTUiQ39dKeUjYRjkv7lOZU1Dgif2rIqrTzX/1wV2hfKu9TOm1IHkdSijfLswxTFzl/cvir+SLSQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
|
|
@ -5280,9 +5292,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
|
||||
"integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
|
|
@ -5295,6 +5307,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"node_modules/decimal.js": {
|
||||
"version": "10.4.3",
|
||||
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz",
|
||||
"integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA=="
|
||||
},
|
||||
"node_modules/decimal.js-light": {
|
||||
"version": "2.5.1",
|
||||
"resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz",
|
||||
|
|
@ -5515,6 +5532,19 @@
|
|||
"url": "https://github.com/fb55/domutils?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz",
|
||||
"integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.0",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/duplexer": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
|
||||
|
|
@ -5672,12 +5702,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/es-define-property": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz",
|
||||
"integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==",
|
||||
"dependencies": {
|
||||
"get-intrinsic": "^1.2.4"
|
||||
},
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
|
|
@ -6619,9 +6646,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/framer-motion": {
|
||||
"version": "11.13.1",
|
||||
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.13.1.tgz",
|
||||
"integrity": "sha512-F40tpGTHByhn9h3zdBQPcEro+pSLtzARcocbNqAyfBI+u9S+KZuHH/7O9+z+GEkoF3eqFxfvVw0eBDytohwqmQ==",
|
||||
"version": "11.13.3",
|
||||
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.13.3.tgz",
|
||||
"integrity": "sha512-3ZSNuYpDFeNxqVKUyYipOm5A1fXSbMje1XIfEWxKTJ4ughl5FEjvkp6gKmFHLjzwijCVU/PjsMNlTMVCmi+Twg==",
|
||||
"dependencies": {
|
||||
"motion-dom": "^11.13.0",
|
||||
"motion-utils": "^11.13.0",
|
||||
|
|
@ -6707,15 +6734,18 @@
|
|||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz",
|
||||
"integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==",
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.5.tgz",
|
||||
"integrity": "sha512-Y4+pKa7XeRUPWFNvOOYHkRYrfzW07oraURSvjDmRVOJ748OrVmeXtpE4+GCEHncjCjkTxPNRt8kEbxDhsn6VTg==",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.0",
|
||||
"dunder-proto": "^1.0.0",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2",
|
||||
"has-proto": "^1.0.1",
|
||||
"has-symbols": "^1.0.3",
|
||||
"hasown": "^2.0.0"
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
|
|
@ -7034,11 +7064,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/has-proto": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.1.0.tgz",
|
||||
"integrity": "sha512-QLdzI9IIO1Jg7f9GT1gXpPpXArAn6cS31R1eEZqz08Gc+uQ8/XiqHWt17Fiw+2p6oTTIq5GXEpQkAlA88YRl/Q==",
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz",
|
||||
"integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7"
|
||||
"dunder-proto": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
|
|
@ -7717,13 +7748,13 @@
|
|||
"integrity": "sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg=="
|
||||
},
|
||||
"node_modules/intl-messageformat": {
|
||||
"version": "10.7.7",
|
||||
"resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.7.7.tgz",
|
||||
"integrity": "sha512-F134jIoeYMro/3I0h08D0Yt4N9o9pjddU/4IIxMMURqbAtI2wu70X8hvG1V48W49zXHXv3RKSF/po+0fDfsGjA==",
|
||||
"version": "10.7.10",
|
||||
"resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.7.10.tgz",
|
||||
"integrity": "sha512-hp7iejCBiJdW3zmOe18FdlJu8U/JsADSDiBPQhfdSeI8B9POtvPRvPh3nMlvhYayGMKLv6maldhR7y3Pf1vkpw==",
|
||||
"dependencies": {
|
||||
"@formatjs/ecma402-abstract": "2.2.4",
|
||||
"@formatjs/fast-memoize": "2.2.3",
|
||||
"@formatjs/icu-messageformat-parser": "2.9.4",
|
||||
"@formatjs/ecma402-abstract": "2.3.1",
|
||||
"@formatjs/fast-memoize": "2.2.5",
|
||||
"@formatjs/icu-messageformat-parser": "2.9.7",
|
||||
"tslib": "2"
|
||||
}
|
||||
},
|
||||
|
|
@ -8454,9 +8485,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/katex": {
|
||||
"version": "0.16.11",
|
||||
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.11.tgz",
|
||||
"integrity": "sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ==",
|
||||
"version": "0.16.15",
|
||||
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.15.tgz",
|
||||
"integrity": "sha512-yE9YJIEAk2aZ+FL/G8r+UGw0CTUzEA8ZFy6E+8tc3spHUKq3qBnzCkI1CQwGoI9atJhVyFPEypQsTY7mJ1Pi9w==",
|
||||
"funding": [
|
||||
"https://opencollective.com/katex",
|
||||
"https://github.com/sponsors/katex"
|
||||
|
|
@ -10381,9 +10412,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/next-intl": {
|
||||
"version": "3.25.3",
|
||||
"resolved": "https://registry.npmjs.org/next-intl/-/next-intl-3.25.3.tgz",
|
||||
"integrity": "sha512-3VQ+OZdU9Z2enx5uWLYfmd/eb/gZN6QIfj59ROE/R+MTSD7ZAOPsGFnKqj5wwqm4EISGviYenkSuxypyYnhomA==",
|
||||
"version": "3.26.0",
|
||||
"resolved": "https://registry.npmjs.org/next-intl/-/next-intl-3.26.0.tgz",
|
||||
"integrity": "sha512-gkamnHIANQzeW8xpTGRxd0xiOCztQhY8GDp79fgdlw0GioqrjTEfSWLhHkgaAtvHRbuh/ByJdwiEY5eNK9bUSQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
|
|
@ -10393,11 +10424,11 @@
|
|||
"dependencies": {
|
||||
"@formatjs/intl-localematcher": "^0.5.4",
|
||||
"negotiator": "^1.0.0",
|
||||
"use-intl": "^3.25.3"
|
||||
"use-intl": "^3.26.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0"
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/next-mdx-remote": {
|
||||
|
|
@ -11479,9 +11510,9 @@
|
|||
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
|
||||
},
|
||||
"node_modules/react-hook-form": {
|
||||
"version": "7.53.2",
|
||||
"resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.53.2.tgz",
|
||||
"integrity": "sha512-YVel6fW5sOeedd1524pltpHX+jgU2u3DSDtXEaBORNdqiNrsX/nUI/iGXONegttg0mJVnfrIkiV0cmTU6Oo2xw==",
|
||||
"version": "7.54.0",
|
||||
"resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.54.0.tgz",
|
||||
"integrity": "sha512-PS05+UQy/IdSbJNojBypxAo9wllhHgGmyr8/dyGQcPoiMf3e7Dfb9PWYVRco55bLbxH9S+1yDDJeTdlYCSxO3A==",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
|
|
@ -11819,18 +11850,19 @@
|
|||
"integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg=="
|
||||
},
|
||||
"node_modules/reflect.getprototypeof": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.7.tgz",
|
||||
"integrity": "sha512-bMvFGIUKlc/eSfXNX+aZ+EL95/EgZzuwA0OBPTbZZDEJw/0AkentjMuM1oiRfwHrshqk4RzdgiTg5CcDalXN5g==",
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.8.tgz",
|
||||
"integrity": "sha512-B5dj6usc5dkk8uFliwjwDHM8To5/QwdKz9JcBZ8Ic4G1f0YmeeJTtE/ZTdgRFPAfxZFiUaPhZ1Jcs4qeagItGQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"call-bind": "^1.0.8",
|
||||
"define-properties": "^1.2.1",
|
||||
"dunder-proto": "^1.0.0",
|
||||
"es-abstract": "^1.23.5",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.4",
|
||||
"gopd": "^1.0.1",
|
||||
"which-builtin-type": "^1.1.4"
|
||||
"gopd": "^1.2.0",
|
||||
"which-builtin-type": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
|
|
@ -12540,9 +12572,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/sonner": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/sonner/-/sonner-1.7.0.tgz",
|
||||
"integrity": "sha512-W6dH7m5MujEPyug3lpI2l3TC3Pp1+LTgK0Efg+IHDrBbtEjyCmCHHo6yfNBOsf1tFZ6zf+jceWwB38baC8yO9g==",
|
||||
"version": "1.7.1",
|
||||
"resolved": "https://registry.npmjs.org/sonner/-/sonner-1.7.1.tgz",
|
||||
"integrity": "sha512-b6LHBfH32SoVasRFECrdY8p8s7hXPDn3OHUFbZZbiB1ctLS9Gdh6rpX2dVrpQA0kiL5jcRzDDldwwLkSKk3+QQ==",
|
||||
"peerDependencies": {
|
||||
"react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
||||
"react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
||||
|
|
@ -13762,23 +13794,23 @@
|
|||
}
|
||||
},
|
||||
"node_modules/use-intl": {
|
||||
"version": "3.25.3",
|
||||
"resolved": "https://registry.npmjs.org/use-intl/-/use-intl-3.25.3.tgz",
|
||||
"integrity": "sha512-zF+GHRx7auT1qpmiPMN+RnzSad6W5ZjhOpgC5Li/TByqCkMs4SP3xcd8C0jWxT8YI8Ucl518bnkS+gvKIvrXjw==",
|
||||
"version": "3.26.0",
|
||||
"resolved": "https://registry.npmjs.org/use-intl/-/use-intl-3.26.0.tgz",
|
||||
"integrity": "sha512-HGXmpjGlbEv1uFZPfm557LK8p/hv0pKF9UwnrJeHUTxQx6bUGzMgpmPRLCVY3zkr7hfjy4LPwQJfk4Fhnn+dIg==",
|
||||
"dependencies": {
|
||||
"@formatjs/fast-memoize": "^2.2.0",
|
||||
"intl-messageformat": "^10.5.14"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0"
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/use-isomorphic-layout-effect": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz",
|
||||
"integrity": "sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==",
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.2.0.tgz",
|
||||
"integrity": "sha512-q6ayo8DWoPZT0VdG4u3D3uxcgONP3Mevx2i2b0434cwWBoL+aelL1DzkXI6w3PhTZzUeR2kaVlZn70iCiseP6w==",
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
|
|
@ -13816,11 +13848,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/use-sync-external-store": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz",
|
||||
"integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==",
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.4.0.tgz",
|
||||
"integrity": "sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw==",
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/util-deprecate": {
|
||||
|
|
|
|||
|
|
@ -4,53 +4,27 @@ import axios from "axios";
|
|||
import Cookies from "js-cookie";
|
||||
import qs from "qs";
|
||||
|
||||
// export async function httpPost(pathUrl: any, headers: any, data?: any) {
|
||||
// const response = await axiosBaseInstance
|
||||
// .post(pathUrl, data, { headers })
|
||||
// .catch(function (error: any) {
|
||||
// console.log(error);
|
||||
// return error.response;
|
||||
// });
|
||||
// console.log("Response base svc : ", response);
|
||||
// if (response?.status == 200 || response?.status == 201) {
|
||||
// return {
|
||||
// error: false,
|
||||
// message: "success",
|
||||
// data: response?.data,
|
||||
// };
|
||||
// } else {
|
||||
// return {
|
||||
// error: true,
|
||||
// message: response?.data?.message || response?.data || null,
|
||||
// data: null,
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
|
||||
const baseURL = "https://netidhub.com/api/";
|
||||
const tokenAuth = Cookies.get("access_token")
|
||||
? Cookies.get("access_token")
|
||||
: null;
|
||||
|
||||
export async function postAPI(url: any, data: any) {
|
||||
const headers = {
|
||||
Authorization: `Bearer ${tokenAuth}`,
|
||||
};
|
||||
const response = await axiosInstance
|
||||
.post(url, qs.stringify(data), { headers })
|
||||
.catch((error) => error.response);
|
||||
if (response?.status > 300) {
|
||||
return {
|
||||
error: true,
|
||||
message: response?.data.error_description,
|
||||
data: null,
|
||||
};
|
||||
}
|
||||
return {
|
||||
error: false,
|
||||
message: "success",
|
||||
data: response?.data,
|
||||
};
|
||||
export async function httpPost(pathUrl: any, headers: any, data?: any) {
|
||||
const response = await axiosBaseInstance
|
||||
.post(pathUrl, data, { headers })
|
||||
.catch(function (error: any) {
|
||||
console.log(error);
|
||||
return error.response;
|
||||
});
|
||||
console.log("Response base svc : ", response);
|
||||
if (response?.status == 200 || response?.status == 201) {
|
||||
return {
|
||||
error: false,
|
||||
message: "success",
|
||||
data: response?.data,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
error: true,
|
||||
message: response?.data?.message || response?.data || null,
|
||||
data: null,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function httpGet(pathUrl: any, headers: any) {
|
||||
|
|
|
|||
|
|
@ -1,143 +0,0 @@
|
|||
import { httpGet, httpPost } from "./http-config/http-base-service";
|
||||
import {
|
||||
httpDeleteInterceptor,
|
||||
httpGetInterceptor,
|
||||
httpPostInterceptor,
|
||||
httpPutInterceptor,
|
||||
} from "./http-config/http-interceptor-service";
|
||||
|
||||
export async function getPublicListPpidData(categoryId: number) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGet(`/ppid-datas?categoryId=${categoryId}`, headers);
|
||||
}
|
||||
|
||||
export async function getListCategories(size: number, page: number) {
|
||||
return await httpGetInterceptor(
|
||||
`/ppid-data-categories?page=${page}&size=${size}&isOnlyTop=true`
|
||||
);
|
||||
}
|
||||
|
||||
export async function updateCategoryPosition(category: any) {
|
||||
const pathUrl = `/ppid-data-categories/position`;
|
||||
return await httpPostInterceptor(pathUrl, category);
|
||||
}
|
||||
|
||||
export async function getListSubCategories(
|
||||
size: number,
|
||||
page: number,
|
||||
parentId: number
|
||||
) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGetInterceptor(
|
||||
`/ppid-data-categories?page=${page}&size=${size}&parentId=${parentId}`
|
||||
);
|
||||
}
|
||||
|
||||
export async function getPublicListCategoriesByParentId(
|
||||
id: any,
|
||||
limit: number,
|
||||
levelGroup?: string
|
||||
) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGet(
|
||||
`/ppid-data-categories?parentId=${id}&isPpidDataIncluded=true&sort=asc&sortBy=position&limit=${limit}${
|
||||
levelGroup ? `&levelGroup=${levelGroup}` : ""
|
||||
}`,
|
||||
headers
|
||||
);
|
||||
}
|
||||
|
||||
export async function getListCategoriesByParentId(
|
||||
id: any,
|
||||
limit: number,
|
||||
levelGroup?: string
|
||||
) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGetInterceptor(
|
||||
`/ppid-data-categories?parentId=${id}&isPpidDataIncluded=true&sort=asc&sortBy=position&limit=${limit}${
|
||||
levelGroup ? `&levelGroup=${levelGroup}` : ""
|
||||
}`
|
||||
);
|
||||
}
|
||||
|
||||
export async function getListCategoriesById(id: any) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGetInterceptor(`/ppid-data-categories/${id}`);
|
||||
}
|
||||
|
||||
export async function getListCategoriesBySlug(slug: any) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGetInterceptor(`/ppid-data-categories/slug/${slug}`);
|
||||
}
|
||||
|
||||
export async function getPublicListCategoriesBySlug(slug: any) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGet(`/ppid-data-categories/slug/${slug}`, headers);
|
||||
}
|
||||
|
||||
export async function getList(categoryId: number) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGetInterceptor(`/ppid-datas?categoryId=1`);
|
||||
}
|
||||
|
||||
export async function createArticle(data: any) {
|
||||
const pathUrl = `/articles`;
|
||||
return await httpPostInterceptor(pathUrl, data);
|
||||
}
|
||||
|
||||
export async function createPublicCategory(request: any) {
|
||||
const pathUrl = `/ppid-data-categories`;
|
||||
return await httpPostInterceptor(pathUrl, request);
|
||||
}
|
||||
|
||||
export async function uploadPublicThumbnail(id: number, data: any) {
|
||||
const headers = {
|
||||
"Content-Type": "multipart/form-data",
|
||||
};
|
||||
const pathUrl = `ppid-data-categories/thumbnail/${id}`;
|
||||
return await httpPost(pathUrl, headers, data);
|
||||
}
|
||||
|
||||
export async function getPublicCategoryById(id: any) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGetInterceptor(`/ppid-data-categories/${id}`);
|
||||
}
|
||||
|
||||
export async function updatePublicCategory(id: any, request: any) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
return await httpPutInterceptor(`/ppid-data-categories/${id}`, request);
|
||||
}
|
||||
|
||||
export async function deletePublicCategory(id: any) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
return await httpDeleteInterceptor(`/ppid-data-categories/${id}`);
|
||||
}
|
||||
|
||||
export async function getParentCategories() {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGet(`ppid-data-categories?isOnlyTop=true`, headers);
|
||||
}
|
||||
Loading…
Reference in New Issue