fix:auth, service folder delete
This commit is contained in:
parent
854994e2c8
commit
9b9752265a
|
|
@ -33,7 +33,7 @@ import Image from "next/image";
|
||||||
import {
|
import {
|
||||||
createAdvertise,
|
createAdvertise,
|
||||||
createMediaFileAdvertise,
|
createMediaFileAdvertise,
|
||||||
} from "@/service/advertisement";
|
} from "@/services/advertisement";
|
||||||
|
|
||||||
const createArticleSchema = z.object({
|
const createArticleSchema = z.object({
|
||||||
title: z.string().min(2, {
|
title: z.string().min(2, {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import withReactContent from "sweetalert2-react-content";
|
||||||
import { Input, Textarea } from "@heroui/input";
|
import { Input, Textarea } from "@heroui/input";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
import { useParams, useRouter } from "next/navigation";
|
import { useParams, useRouter } from "next/navigation";
|
||||||
import { getCommentById, saveCommentStatus } from "@/service/comment";
|
import { getCommentById, saveCommentStatus } from "@/services/comment";
|
||||||
import {
|
import {
|
||||||
Modal,
|
Modal,
|
||||||
ModalBody,
|
ModalBody,
|
||||||
|
|
@ -18,9 +18,9 @@ import {
|
||||||
ModalHeader,
|
ModalHeader,
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
} from "@heroui/react";
|
} from "@heroui/react";
|
||||||
import { getArticleById } from "@/service/article";
|
import { getArticleById } from "@/services/article";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { postArticleComment } from "@/service/master-user";
|
import { postArticleComment } from "@/services/master-user";
|
||||||
|
|
||||||
interface DetailComments {
|
interface DetailComments {
|
||||||
id: number;
|
id: number;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import * as z from "zod";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
import { Fragment, useEffect, useState } from "react";
|
import { Fragment, useEffect, useState } from "react";
|
||||||
import { getArticleByCategory } from "@/service/article";
|
import { getArticleByCategory } from "@/services/article";
|
||||||
import ReactSelect from "react-select";
|
import ReactSelect from "react-select";
|
||||||
import makeAnimated from "react-select/animated";
|
import makeAnimated from "react-select/animated";
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
|
|
@ -30,7 +30,7 @@ import { close, error, loading } from "@/config/swal";
|
||||||
import {
|
import {
|
||||||
createCategory,
|
createCategory,
|
||||||
uploadCategoryThumbnail,
|
uploadCategoryThumbnail,
|
||||||
} from "@/service/master-categories";
|
} from "@/services/master-categories";
|
||||||
import Swal from "sweetalert2";
|
import Swal from "sweetalert2";
|
||||||
import withReactContent from "sweetalert2-react-content";
|
import withReactContent from "sweetalert2-react-content";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import PasswordForm from "@/components/form/settings/password";
|
import PasswordForm from "@/components/form/settings/password";
|
||||||
import ProfileForm from "@/components/form/settings/profile";
|
import ProfileForm from "@/components/form/settings/profile";
|
||||||
import { close, loading } from "@/config/swal";
|
import { close, loading } from "@/config/swal";
|
||||||
import { getProfile } from "@/service/master-user";
|
import { getProfile } from "@/services/master-user";
|
||||||
import { Tab, Tabs } from "@heroui/react";
|
import { Tab, Tabs } from "@heroui/react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { HumasLayout } from "@/components/layout/humas-layout";
|
import { HumasLayout } from "@/components/layout/humas-layout";
|
||||||
import DetailPage from "@/components/main/detail/new-detail";
|
import DetailPage from "@/components/main/detail/new-detail";
|
||||||
import { getArticleById } from "@/service/article";
|
import { getArticleById } from "@/services/article";
|
||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { Button } from "@heroui/button";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import { close, error, loading } from "@/config/swal";
|
import { close, error, loading } from "@/config/swal";
|
||||||
import { postSignIn, resetPassword } from "@/service/master-user";
|
import { postSignIn, resetPassword } from "@/services/master-user";
|
||||||
import { useRouter, useSearchParams } from "next/navigation";
|
import { useRouter, useSearchParams } from "next/navigation";
|
||||||
import Swal from "sweetalert2";
|
import Swal from "sweetalert2";
|
||||||
import withReactContent from "sweetalert2-react-content";
|
import withReactContent from "sweetalert2-react-content";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { HumasLayout } from "@/components/layout/humas-layout";
|
import { HumasLayout } from "@/components/layout/humas-layout";
|
||||||
import { getCustomStaticDetailBySlug } from "@/service/static-page-service";
|
import { getCustomStaticDetailBySlug } from "@/services/static-page-service";
|
||||||
import { Card, CircularProgress } from "@heroui/react";
|
import { Card, CircularProgress } from "@heroui/react";
|
||||||
import { useParams } from "next/navigation";
|
import { useParams } from "next/navigation";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import {
|
||||||
getArticleByCategory,
|
getArticleByCategory,
|
||||||
uploadArticleFile,
|
uploadArticleFile,
|
||||||
uploadArticleThumbnail,
|
uploadArticleThumbnail,
|
||||||
} from "@/service/article";
|
} from "@/services/article";
|
||||||
import ReactSelect from "react-select";
|
import ReactSelect from "react-select";
|
||||||
import makeAnimated from "react-select/animated";
|
import makeAnimated from "react-select/animated";
|
||||||
import {
|
import {
|
||||||
|
|
@ -51,11 +51,11 @@ import { convertDateFormatNoTime, htmlToString } from "@/utils/global";
|
||||||
import { close, error, loading, successToast } from "@/config/swal";
|
import { close, error, loading, successToast } from "@/config/swal";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { getCategoryById } from "@/service/master-categories";
|
import { getCategoryById } from "@/services/master-categories";
|
||||||
import {
|
import {
|
||||||
saveManualContext,
|
saveManualContext,
|
||||||
updateManualArticle,
|
updateManualArticle,
|
||||||
} from "@/service/generate-article";
|
} from "@/services/generate-article";
|
||||||
import GenerateContentRewriteForm from "./generate-ai-content-rewrite-form";
|
import GenerateContentRewriteForm from "./generate-ai-content-rewrite-form";
|
||||||
import Datepicker from "react-tailwindcss-datepicker";
|
import Datepicker from "react-tailwindcss-datepicker";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import {
|
||||||
updateArticle,
|
updateArticle,
|
||||||
uploadArticleFile,
|
uploadArticleFile,
|
||||||
uploadArticleThumbnail,
|
uploadArticleThumbnail,
|
||||||
} from "@/service/article";
|
} from "@/services/article";
|
||||||
import ReactSelect from "react-select";
|
import ReactSelect from "react-select";
|
||||||
import makeAnimated from "react-select/animated";
|
import makeAnimated from "react-select/animated";
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import {
|
||||||
getSeoScore,
|
getSeoScore,
|
||||||
regenerateArticle,
|
regenerateArticle,
|
||||||
updateManualArticle,
|
updateManualArticle,
|
||||||
} from "@/service/generate-article";
|
} from "@/services/generate-article";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
import Swal from "sweetalert2";
|
import Swal from "sweetalert2";
|
||||||
import withReactContent from "sweetalert2-react-content";
|
import withReactContent from "sweetalert2-react-content";
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { useEffect, useRef, useState } from "react";
|
||||||
import {
|
import {
|
||||||
getDetailArticle,
|
getDetailArticle,
|
||||||
updateManualArticle,
|
updateManualArticle,
|
||||||
} from "@/service/generate-article";
|
} from "@/services/generate-article";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
import Swal from "sweetalert2";
|
import Swal from "sweetalert2";
|
||||||
import withReactContent from "sweetalert2-react-content";
|
import withReactContent from "sweetalert2-react-content";
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import {
|
||||||
getGenerateKeywords,
|
getGenerateKeywords,
|
||||||
getGenerateRewriter,
|
getGenerateRewriter,
|
||||||
getGenerateTitle,
|
getGenerateTitle,
|
||||||
} from "@/service/generate-article";
|
} from "@/services/generate-article";
|
||||||
import { delay } from "@/utils/global";
|
import { delay } from "@/utils/global";
|
||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
import GetSeoScore from "./get-seo-score-form";
|
import GetSeoScore from "./get-seo-score-form";
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import {
|
||||||
getDetailArticle,
|
getDetailArticle,
|
||||||
getGenerateKeywords,
|
getGenerateKeywords,
|
||||||
getGenerateTitle,
|
getGenerateTitle,
|
||||||
} from "@/service/generate-article";
|
} from "@/services/generate-article";
|
||||||
import { delay } from "@/utils/global";
|
import { delay } from "@/utils/global";
|
||||||
import GetSeoScore from "./get-seo-score-form";
|
import GetSeoScore from "./get-seo-score-form";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { error } from "@/config/swal";
|
import { error } from "@/config/swal";
|
||||||
import { createArticle, getArticleByCategory } from "@/service/article";
|
import { createArticle, getArticleByCategory } from "@/services/article";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
|
|
@ -24,7 +24,7 @@ import * as z from "zod";
|
||||||
import ReactSelect from "react-select";
|
import ReactSelect from "react-select";
|
||||||
import makeAnimated from "react-select/animated";
|
import makeAnimated from "react-select/animated";
|
||||||
import GenerateSingleArticle from "./generate-single-article-form";
|
import GenerateSingleArticle from "./generate-single-article-form";
|
||||||
import { getDetailArticle } from "@/service/generate-article";
|
import { getDetailArticle } from "@/services/generate-article";
|
||||||
import { delay } from "@/utils/global";
|
import { delay } from "@/utils/global";
|
||||||
import GenerateBulkArticle from "./generate-bulk-article-form";
|
import GenerateBulkArticle from "./generate-bulk-article-form";
|
||||||
import generatedArticleIds from "@/store/generated-article-store";
|
import generatedArticleIds from "@/store/generated-article-store";
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import {
|
||||||
getGenerateTitle,
|
getGenerateTitle,
|
||||||
getGenerateTopicKeywords,
|
getGenerateTopicKeywords,
|
||||||
saveBulkArticle,
|
saveBulkArticle,
|
||||||
} from "@/service/generate-article";
|
} from "@/services/generate-article";
|
||||||
|
|
||||||
const writingStyle = [
|
const writingStyle = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import { Controller, useForm } from "react-hook-form";
|
||||||
import * as z from "zod";
|
import * as z from "zod";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { close, error, loading } from "@/config/swal";
|
import { close, error, loading } from "@/config/swal";
|
||||||
import { getGenerateRewriter } from "@/service/generate-article";
|
import { getGenerateRewriter } from "@/services/generate-article";
|
||||||
import TranscriptDraftTable from "@/components/table/disestages/transcript-draft-table";
|
import TranscriptDraftTable from "@/components/table/disestages/transcript-draft-table";
|
||||||
import ArticleDraftTable from "@/components/table/disestages/article-draft-table";
|
import ArticleDraftTable from "@/components/table/disestages/article-draft-table";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import {
|
||||||
generateDataArticle,
|
generateDataArticle,
|
||||||
getGenerateKeywords,
|
getGenerateKeywords,
|
||||||
getGenerateTitle,
|
getGenerateTitle,
|
||||||
} from "@/service/generate-article";
|
} from "@/services/generate-article";
|
||||||
|
|
||||||
const writingStyle = [
|
const writingStyle = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { error } from "@/config/swal";
|
import { error } from "@/config/swal";
|
||||||
import { getSeoScore } from "@/service/generate-article";
|
import { getSeoScore } from "@/services/generate-article";
|
||||||
import { Accordion, AccordionItem, CircularProgress } from "@heroui/react";
|
import { Accordion, AccordionItem, CircularProgress } from "@heroui/react";
|
||||||
|
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import { close, error, loading } from "@/config/swal";
|
||||||
import {
|
import {
|
||||||
generateSpeechToText,
|
generateSpeechToText,
|
||||||
getTranscriptById,
|
getTranscriptById,
|
||||||
} from "@/service/generate-article";
|
} from "@/services/generate-article";
|
||||||
import { delay } from "@/utils/global";
|
import { delay } from "@/utils/global";
|
||||||
|
|
||||||
// import OperatorArticleTable from "@/components/table/assistant/create-content/operator/operator-article-table";
|
// import OperatorArticleTable from "@/components/table/assistant/create-content/operator/operator-article-table";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { close, error, loading } from "@/config/swal";
|
import { close, error, loading } from "@/config/swal";
|
||||||
import { createArticle, getArticleByCategory } from "@/service/article";
|
import { createArticle, getArticleByCategory } from "@/services/article";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
|
|
@ -21,7 +21,7 @@ import withReactContent from "sweetalert2-react-content";
|
||||||
import * as z from "zod";
|
import * as z from "zod";
|
||||||
import ReactSelect from "react-select";
|
import ReactSelect from "react-select";
|
||||||
import makeAnimated from "react-select/animated";
|
import makeAnimated from "react-select/animated";
|
||||||
import { saveManualContext } from "@/service/generate-article";
|
import { saveManualContext } from "@/services/generate-article";
|
||||||
|
|
||||||
const articleSchema = z.object({
|
const articleSchema = z.object({
|
||||||
title: z.string().min(1, { message: "Required" }),
|
title: z.string().min(1, { message: "Required" }),
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { error } from "@/config/swal";
|
import { error } from "@/config/swal";
|
||||||
import { getSeoScore } from "@/service/generate-article";
|
import { getSeoScore } from "@/services/generate-article";
|
||||||
import { Accordion, AccordionItem, CircularProgress } from "@heroui/react";
|
import { Accordion, AccordionItem, CircularProgress } from "@heroui/react";
|
||||||
|
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
|
|
||||||
|
|
@ -1,184 +1,182 @@
|
||||||
'use client'
|
"use client";
|
||||||
import { error } from '@/config/swal';
|
import { error } from "@/config/swal";
|
||||||
import { createMasterUserRole, getMasterUserRoleById } from '@/service/master-user-role';
|
import {
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
createMasterUserRole,
|
||||||
|
getMasterUserRoleById,
|
||||||
|
} from "@/services/master-user-role";
|
||||||
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { Button, Card, Input, Textarea } from "@heroui/react";
|
import { Button, Card, Input, Textarea } from "@heroui/react";
|
||||||
import Link from 'next/link';
|
import Link from "next/link";
|
||||||
import { usePathname, useRouter } from 'next/navigation';
|
import { usePathname, useRouter } from "next/navigation";
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from "react-hook-form";
|
||||||
import Swal from 'sweetalert2';
|
import Swal from "sweetalert2";
|
||||||
import withReactContent from 'sweetalert2-react-content';
|
import withReactContent from "sweetalert2-react-content";
|
||||||
import { z } from 'zod';
|
import { z } from "zod";
|
||||||
|
|
||||||
const masterUserSchema = z.object({
|
const masterUserSchema = z.object({
|
||||||
code: z.string().min(1, { message: "Required" }),
|
code: z.string().min(1, { message: "Required" }),
|
||||||
description: z.string().min(1, { message: "Required" }),
|
description: z.string().min(1, { message: "Required" }),
|
||||||
levelNumber: z.string().min(1, { message: "Required" }),
|
levelNumber: z.string().min(1, { message: "Required" }),
|
||||||
name: z.string().min(1, { message: "Required" }),
|
name: z.string().min(1, { message: "Required" }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default function FormDetailMasterUserRole() {
|
export default function FormDetailMasterUserRole() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const MySwal = withReactContent(Swal);
|
const MySwal = withReactContent(Swal);
|
||||||
const [userRole, setUserRole] = useState<any>();
|
const [userRole, setUserRole] = useState<any>();
|
||||||
const [code, setCode] = useState<string>();
|
const [code, setCode] = useState<string>();
|
||||||
const [description, setDescription] = useState<string>();
|
const [description, setDescription] = useState<string>();
|
||||||
const [levelNumber, setLevelNumber] = useState<any>(1);
|
const [levelNumber, setLevelNumber] = useState<any>(1);
|
||||||
const [name, setName] = useState<string>();
|
const [name, setName] = useState<string>();
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const splitPathname = pathname.split('/');
|
const splitPathname = pathname.split("/");
|
||||||
const id = splitPathname[splitPathname.length - 1];
|
const id = splitPathname[splitPathname.length - 1];
|
||||||
|
|
||||||
const formOptions = { resolver: zodResolver(masterUserSchema) };
|
const formOptions = { resolver: zodResolver(masterUserSchema) };
|
||||||
type MicroIssueSchema = z.infer<typeof masterUserSchema>;
|
type MicroIssueSchema = z.infer<typeof masterUserSchema>;
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
control,
|
control,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
setValue,
|
setValue,
|
||||||
formState: { errors },
|
formState: { errors },
|
||||||
} = useForm<MicroIssueSchema>(formOptions);
|
} = useForm<MicroIssueSchema>(formOptions);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
async function initState() {
|
||||||
|
const res = await getMasterUserRoleById(id);
|
||||||
|
setUserRole(res.data?.data);
|
||||||
|
setCode(res.data?.data?.code);
|
||||||
|
setName(res.data.data?.name);
|
||||||
|
setDescription(res.data.data?.description);
|
||||||
|
setLevelNumber(res.data.data?.level_number);
|
||||||
|
|
||||||
useEffect(() => {
|
console.log("Data MasterUser", userRole);
|
||||||
async function initState() {
|
}
|
||||||
const res = await getMasterUserRoleById(id);
|
|
||||||
setUserRole(res.data?.data);
|
|
||||||
setCode(res.data?.data?.code)
|
|
||||||
setName(res.data.data?.name)
|
|
||||||
setDescription(res.data.data?.description)
|
|
||||||
setLevelNumber(res.data.data?.level_number)
|
|
||||||
|
|
||||||
console.log("Data MasterUser", userRole);
|
initState();
|
||||||
}
|
}, []);
|
||||||
|
|
||||||
initState();
|
async function save(data: any) {
|
||||||
}, []);
|
const formData = {
|
||||||
|
code: code,
|
||||||
|
description: description,
|
||||||
async function save(data: any) {
|
level_number: levelNumber,
|
||||||
const formData = {
|
name: name,
|
||||||
code: code,
|
|
||||||
description: description,
|
|
||||||
level_number: levelNumber,
|
|
||||||
name: name,
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log("Form MasterUser:", formData);
|
|
||||||
const response = await createMasterUserRole(formData);
|
|
||||||
|
|
||||||
if (response?.error) {
|
|
||||||
error(response.message);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
successSubmit("/admin/master-role");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function successSubmit(redirect: any) {
|
console.log("Form MasterUser:", formData);
|
||||||
MySwal.fire({
|
const response = await createMasterUserRole(formData);
|
||||||
title: "Sukses",
|
|
||||||
icon: "success",
|
if (response?.error) {
|
||||||
confirmButtonColor: "#3085d6",
|
error(response.message);
|
||||||
confirmButtonText: "OK",
|
return false;
|
||||||
}).then((result) => {
|
|
||||||
if (result.isConfirmed) {
|
|
||||||
router.push(redirect);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onSubmit(data: any) {
|
successSubmit("/admin/master-role");
|
||||||
MySwal.fire({
|
}
|
||||||
title: "Simpan Data",
|
|
||||||
text: "",
|
|
||||||
icon: "warning",
|
|
||||||
showCancelButton: true,
|
|
||||||
cancelButtonColor: "#d33",
|
|
||||||
confirmButtonColor: "#3085d6",
|
|
||||||
confirmButtonText: "Simpan",
|
|
||||||
}).then((result) => {
|
|
||||||
if (result.isConfirmed) {
|
|
||||||
save(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
function successSubmit(redirect: any) {
|
||||||
<div className='mx-5 my-5 overflow-y-auto'>
|
MySwal.fire({
|
||||||
<form method="POST" onSubmit={handleSubmit(onSubmit)}>
|
title: "Sukses",
|
||||||
<Card className='rounded-md p-5 space-y-5'>
|
icon: "success",
|
||||||
<div>
|
confirmButtonColor: "#3085d6",
|
||||||
<Input
|
confirmButtonText: "OK",
|
||||||
isReadOnly
|
}).then((result) => {
|
||||||
type="text"
|
if (result.isConfirmed) {
|
||||||
{...register("code")}
|
router.push(redirect);
|
||||||
label="Code"
|
}
|
||||||
variant='bordered'
|
});
|
||||||
placeholder="Enter Text"
|
}
|
||||||
labelPlacement='outside'
|
|
||||||
value={code}
|
async function onSubmit(data: any) {
|
||||||
onChange={(e) => setCode(e.target.value)}
|
MySwal.fire({
|
||||||
/>
|
title: "Simpan Data",
|
||||||
{errors.code?.message}
|
text: "",
|
||||||
</div>
|
icon: "warning",
|
||||||
<div>
|
showCancelButton: true,
|
||||||
<Input
|
cancelButtonColor: "#d33",
|
||||||
isReadOnly
|
confirmButtonColor: "#3085d6",
|
||||||
type="text"
|
confirmButtonText: "Simpan",
|
||||||
{...register("name")}
|
}).then((result) => {
|
||||||
label="Role"
|
if (result.isConfirmed) {
|
||||||
variant='bordered'
|
save(data);
|
||||||
placeholder="Enter Text"
|
}
|
||||||
labelPlacement='outside'
|
});
|
||||||
value={name}
|
}
|
||||||
onChange={(e) => setName(e.target.value)}
|
|
||||||
/>
|
return (
|
||||||
{errors.name?.message}
|
<div className="mx-5 my-5 overflow-y-auto">
|
||||||
</div>
|
<form method="POST" onSubmit={handleSubmit(onSubmit)}>
|
||||||
<div>
|
<Card className="rounded-md p-5 space-y-5">
|
||||||
<Textarea
|
<div>
|
||||||
isReadOnly
|
<Input
|
||||||
label="Description"
|
isReadOnly
|
||||||
{...register("description")}
|
type="text"
|
||||||
labelPlacement="outside"
|
{...register("code")}
|
||||||
placeholder="Enter Text"
|
label="Code"
|
||||||
value={description}
|
variant="bordered"
|
||||||
onValueChange={setDescription}
|
placeholder="Enter Text"
|
||||||
/>
|
labelPlacement="outside"
|
||||||
</div>
|
value={code}
|
||||||
<div>
|
onChange={(e) => setCode(e.target.value)}
|
||||||
<Input
|
/>
|
||||||
type="text"
|
{errors.code?.message}
|
||||||
{...register("levelNumber")}
|
</div>
|
||||||
label="Level Number"
|
<div>
|
||||||
variant='bordered'
|
<Input
|
||||||
placeholder="Enter Text"
|
isReadOnly
|
||||||
labelPlacement='outside'
|
type="text"
|
||||||
value={levelNumber}
|
{...register("name")}
|
||||||
/>
|
label="Role"
|
||||||
{errors.code?.message}
|
variant="bordered"
|
||||||
</div>
|
placeholder="Enter Text"
|
||||||
<div className='flex justify-end gap-3'>
|
labelPlacement="outside"
|
||||||
<Link href={`/admin/master-role`}>
|
value={name}
|
||||||
<Button
|
onChange={(e) => setName(e.target.value)}
|
||||||
color='primary'
|
/>
|
||||||
variant="ghost"
|
{errors.name?.message}
|
||||||
>
|
</div>
|
||||||
Back
|
<div>
|
||||||
</Button>
|
<Textarea
|
||||||
</Link>
|
isReadOnly
|
||||||
{/* <Button
|
label="Description"
|
||||||
|
{...register("description")}
|
||||||
|
labelPlacement="outside"
|
||||||
|
placeholder="Enter Text"
|
||||||
|
value={description}
|
||||||
|
onValueChange={setDescription}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
{...register("levelNumber")}
|
||||||
|
label="Level Number"
|
||||||
|
variant="bordered"
|
||||||
|
placeholder="Enter Text"
|
||||||
|
labelPlacement="outside"
|
||||||
|
value={levelNumber}
|
||||||
|
/>
|
||||||
|
{errors.code?.message}
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-end gap-3">
|
||||||
|
<Link href={`/admin/master-role`}>
|
||||||
|
<Button color="primary" variant="ghost">
|
||||||
|
Back
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
{/* <Button
|
||||||
type="submit"
|
type="submit"
|
||||||
color='primary'
|
color='primary'
|
||||||
variant="solid"
|
variant="solid"
|
||||||
>
|
>
|
||||||
Save
|
Save
|
||||||
</Button> */}
|
</Button> */}
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</form>
|
</form>
|
||||||
</div >
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { getArticleById } from "@/service/article";
|
import { getArticleById } from "@/services/article";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import {
|
||||||
createMasterUser,
|
createMasterUser,
|
||||||
editMasterUsers,
|
editMasterUsers,
|
||||||
getDetailMasterUsers,
|
getDetailMasterUsers,
|
||||||
} from "@/service/master-user";
|
} from "@/services/master-user";
|
||||||
import { MasterUser } from "@/types/globals";
|
import { MasterUser } from "@/types/globals";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import {
|
import {
|
||||||
|
|
@ -30,7 +30,7 @@ import { z } from "zod";
|
||||||
import ReactSelect from "react-select";
|
import ReactSelect from "react-select";
|
||||||
import makeAnimated from "react-select/animated";
|
import makeAnimated from "react-select/animated";
|
||||||
import { getAllUserLevels } from "@/services/user-levels/user-levels-service";
|
import { getAllUserLevels } from "@/services/user-levels/user-levels-service";
|
||||||
import { listUserRole } from "@/service/master-user-role";
|
import { listUserRole } from "@/services/master-user-role";
|
||||||
|
|
||||||
const userSchema = z.object({
|
const userSchema = z.object({
|
||||||
id: z.number(),
|
id: z.number(),
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { error } from "@/config/swal";
|
import { error } from "@/config/swal";
|
||||||
import { createMasterUser } from "@/service/master-user";
|
import { createMasterUser } from "@/services/master-user";
|
||||||
import { createMasterUserRole } from "@/service/master-user-role";
|
import { createMasterUserRole } from "@/services/master-user-role";
|
||||||
import { MasterUser } from "@/types/globals";
|
import { MasterUser } from "@/types/globals";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { close, error, loading } from "@/config/swal";
|
import { close, error, loading } from "@/config/swal";
|
||||||
import { createMasterUser } from "@/service/master-user";
|
import { createMasterUser } from "@/services/master-user";
|
||||||
import { MasterUser } from "@/types/globals";
|
import { MasterUser } from "@/types/globals";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import {
|
import {
|
||||||
|
|
@ -27,7 +27,7 @@ import ReactPasswordChecklist from "react-password-checklist";
|
||||||
import ReactSelect from "react-select";
|
import ReactSelect from "react-select";
|
||||||
import makeAnimated from "react-select/animated";
|
import makeAnimated from "react-select/animated";
|
||||||
import { getAllUserLevels } from "@/services/user-levels/user-levels-service";
|
import { getAllUserLevels } from "@/services/user-levels/user-levels-service";
|
||||||
import { listUserRole } from "@/service/master-user-role";
|
import { listUserRole } from "@/services/master-user-role";
|
||||||
|
|
||||||
const userSchema = z.object({
|
const userSchema = z.object({
|
||||||
id: z.number(),
|
id: z.number(),
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@ import {
|
||||||
savePassword,
|
savePassword,
|
||||||
setupEmail,
|
setupEmail,
|
||||||
updateProfile,
|
updateProfile,
|
||||||
} from "@/service/master-user";
|
} from "@/services/master-user";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import Swal from "sweetalert2";
|
import Swal from "sweetalert2";
|
||||||
import withReactContent from "sweetalert2-react-content";
|
import withReactContent from "sweetalert2-react-content";
|
||||||
import { saveActivity } from "@/service/activity-log";
|
import { saveActivity } from "@/services/activity-log";
|
||||||
import PasswordChecklist from "react-password-checklist";
|
import PasswordChecklist from "react-password-checklist";
|
||||||
import { Image, InputOtp } from "@heroui/react";
|
import { Image, InputOtp } from "@heroui/react";
|
||||||
|
|
||||||
|
|
@ -43,6 +43,9 @@ export default function Login() {
|
||||||
const [accessData, setAccessData] = useState<any>();
|
const [accessData, setAccessData] = useState<any>();
|
||||||
const [profile, setProfile] = useState<any>();
|
const [profile, setProfile] = useState<any>();
|
||||||
const [isValidEmail, setIsValidEmail] = useState(false);
|
const [isValidEmail, setIsValidEmail] = useState(false);
|
||||||
|
const [isResetPassword, setIsResetPassword] = useState(false);
|
||||||
|
const [checkUsernameValue, setCheckUsernameValue] = useState("");
|
||||||
|
const MySwal = withReactContent(Swal);
|
||||||
|
|
||||||
const setValUsername = (e: any) => {
|
const setValUsername = (e: any) => {
|
||||||
const uname = e.replaceAll(/[^\w.-]/g, "");
|
const uname = e.replaceAll(/[^\w.-]/g, "");
|
||||||
|
|
@ -58,96 +61,93 @@ export default function Login() {
|
||||||
if (!username || !password) {
|
if (!username || !password) {
|
||||||
error("Username & Password Wajib Diisi !");
|
error("Username & Password Wajib Diisi !");
|
||||||
} else {
|
} else {
|
||||||
// const response = await emailValidation(data);
|
const response = await emailValidation(data);
|
||||||
// if (response?.error) {
|
|
||||||
// error("Username / Password Tidak Sesuai");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (response?.data?.messages[0] === "Continue to setup email") {
|
|
||||||
// setFirstLogin(true);
|
|
||||||
// } else {
|
|
||||||
// setNeedOtp(true);
|
|
||||||
// }
|
|
||||||
|
|
||||||
loading();
|
|
||||||
const response = await postSignIn(data);
|
|
||||||
if (response?.error) {
|
if (response?.error) {
|
||||||
error("Username / Password Tidak Sesuai");
|
error("Username / Password Tidak Sesuai");
|
||||||
} else {
|
return false;
|
||||||
const profile = await getProfile(response?.data?.data?.access_token);
|
|
||||||
const dateTime: any = new Date();
|
|
||||||
|
|
||||||
const newTime: any = dateTime.getTime() + 10 * 60 * 1000;
|
|
||||||
|
|
||||||
Cookies.set("access_token", response?.data?.data?.access_token, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("refresh_token", response?.data?.data?.refresh_token, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("time_refresh", newTime, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("is_first_login", "true", {
|
|
||||||
secure: true,
|
|
||||||
sameSite: "strict",
|
|
||||||
});
|
|
||||||
const resActivity = await saveActivity(
|
|
||||||
{
|
|
||||||
activityTypeId: 1,
|
|
||||||
url: "https://kontenhumas.com/auth",
|
|
||||||
userId: profile?.data?.data?.id,
|
|
||||||
},
|
|
||||||
accessData?.id_token
|
|
||||||
);
|
|
||||||
Cookies.set("profile_picture", profile?.data?.data?.profilePictureUrl, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("uie", profile?.data?.data?.id, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("ufne", profile?.data?.data?.fullname, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("ulie", profile?.data?.data?.userLevelGroup, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("username", profile?.data?.data?.username, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("urie", profile?.data?.data?.roleId, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("roleName", profile?.data?.data?.roleName, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("masterPoldaId", profile?.data?.data?.masterPoldaId, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("ulne", profile?.data?.data?.userLevelId, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("urce", profile?.data?.data?.roleCode, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
Cookies.set("email", profile?.data?.data?.email, {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
router.push("/admin/dashboard");
|
|
||||||
Cookies.set("status", "login", {
|
|
||||||
expires: 1,
|
|
||||||
});
|
|
||||||
|
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (response?.data?.messages[0] === "Continue to setup email") {
|
||||||
|
setFirstLogin(true);
|
||||||
|
} else {
|
||||||
|
setNeedOtp(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// loading();
|
||||||
|
// const response = await postSignIn(data);
|
||||||
|
// if (response?.error) {
|
||||||
|
// error("Username / Password Tidak Sesuai");
|
||||||
|
// } else {
|
||||||
|
// const profile = await getProfile(response?.data?.data?.access_token);
|
||||||
|
// const dateTime: any = new Date();
|
||||||
|
|
||||||
|
// const newTime: any = dateTime.getTime() + 10 * 60 * 1000;
|
||||||
|
|
||||||
|
// Cookies.set("access_token", response?.data?.data?.access_token, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("refresh_token", response?.data?.data?.refresh_token, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("time_refresh", newTime, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("is_first_login", "true", {
|
||||||
|
// secure: true,
|
||||||
|
// sameSite: "strict",
|
||||||
|
// });
|
||||||
|
// const resActivity = await saveActivity(
|
||||||
|
// {
|
||||||
|
// activityTypeId: 1,
|
||||||
|
// url: "https://kontenhumas.com/auth",
|
||||||
|
// userId: profile?.data?.data?.id,
|
||||||
|
// },
|
||||||
|
// accessData?.id_token
|
||||||
|
// );
|
||||||
|
// Cookies.set("profile_picture", profile?.data?.data?.profilePictureUrl, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("uie", profile?.data?.data?.id, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("ufne", profile?.data?.data?.fullname, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("ulie", profile?.data?.data?.userLevelGroup, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("username", profile?.data?.data?.username, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("urie", profile?.data?.data?.roleId, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("roleName", profile?.data?.data?.roleName, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("masterPoldaId", profile?.data?.data?.masterPoldaId, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("ulne", profile?.data?.data?.userLevelId, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("urce", profile?.data?.data?.roleCode, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// Cookies.set("email", profile?.data?.data?.email, {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
// router.push("/admin/dashboard");
|
||||||
|
// Cookies.set("status", "login", {
|
||||||
|
// expires: 1,
|
||||||
|
// });
|
||||||
|
|
||||||
|
// close();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
const [isResetPassword, setIsResetPassword] = useState(false);
|
|
||||||
const [checkUsernameValue, setCheckUsernameValue] = useState("");
|
|
||||||
const MySwal = withReactContent(Swal);
|
|
||||||
|
|
||||||
const checkUsername = async () => {
|
const checkUsername = async () => {
|
||||||
const res = await checkUsernames(checkUsernameValue);
|
const res = await checkUsernames(checkUsernameValue);
|
||||||
if (res?.error) {
|
if (res?.error) {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import {
|
||||||
getArticleByCategory,
|
getArticleByCategory,
|
||||||
uploadArticleFile,
|
uploadArticleFile,
|
||||||
uploadArticleThumbnail,
|
uploadArticleThumbnail,
|
||||||
} from "@/service/article";
|
} from "@/services/article";
|
||||||
import ReactSelect from "react-select";
|
import ReactSelect from "react-select";
|
||||||
import makeAnimated from "react-select/animated";
|
import makeAnimated from "react-select/animated";
|
||||||
import { Checkbox, Chip } from "@heroui/react";
|
import { Checkbox, Chip } from "@heroui/react";
|
||||||
|
|
@ -37,7 +37,7 @@ import {
|
||||||
createMagazine,
|
createMagazine,
|
||||||
uploadMagazineFile,
|
uploadMagazineFile,
|
||||||
uploadMagazineThumbnail,
|
uploadMagazineThumbnail,
|
||||||
} from "@/service/magazine";
|
} from "@/services/magazine";
|
||||||
|
|
||||||
const CustomEditor = dynamic(
|
const CustomEditor = dynamic(
|
||||||
() => {
|
() => {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import {
|
||||||
getArticleByCategory,
|
getArticleByCategory,
|
||||||
uploadArticleFile,
|
uploadArticleFile,
|
||||||
uploadArticleThumbnail,
|
uploadArticleThumbnail,
|
||||||
} from "@/service/article";
|
} from "@/services/article";
|
||||||
import ReactSelect from "react-select";
|
import ReactSelect from "react-select";
|
||||||
import makeAnimated from "react-select/animated";
|
import makeAnimated from "react-select/animated";
|
||||||
import { Checkbox, Chip } from "@heroui/react";
|
import { Checkbox, Chip } from "@heroui/react";
|
||||||
|
|
@ -41,7 +41,7 @@ import {
|
||||||
updateMagazine,
|
updateMagazine,
|
||||||
uploadMagazineFile,
|
uploadMagazineFile,
|
||||||
uploadMagazineThumbnail,
|
uploadMagazineThumbnail,
|
||||||
} from "@/service/magazine";
|
} from "@/services/magazine";
|
||||||
|
|
||||||
const CustomEditor = dynamic(
|
const CustomEditor = dynamic(
|
||||||
() => {
|
() => {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { error, loading, close } from "@/config/swal";
|
||||||
import { Button, Input } from "@heroui/react";
|
import { Button, Input } from "@heroui/react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { postSignIn } from "@/service/master-user";
|
import { postSignIn } from "@/services/master-user";
|
||||||
|
|
||||||
const images = ["bg1.jpg", "bg2.jpg"];
|
const images = ["bg1.jpg", "bg2.jpg"];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import { Input } from "@heroui/input";
|
||||||
import { EyeFilledIcon, EyeSlashFilledIcon } from "@/components/icons";
|
import { EyeFilledIcon, EyeSlashFilledIcon } from "@/components/icons";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
import PasswordChecklist from "react-password-checklist";
|
import PasswordChecklist from "react-password-checklist";
|
||||||
import { savePassword } from "@/service/master-user";
|
import { savePassword } from "@/services/master-user";
|
||||||
import { close, error, loading } from "@/config/swal";
|
import { close, error, loading } from "@/config/swal";
|
||||||
|
|
||||||
export default function PasswordForm(props: { doFetch: () => void }) {
|
export default function PasswordForm(props: { doFetch: () => void }) {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import withReactContent from "sweetalert2-react-content";
|
||||||
import { Input, Textarea } from "@heroui/input";
|
import { Input, Textarea } from "@heroui/input";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
import { Radio, RadioGroup } from "@heroui/react";
|
import { Radio, RadioGroup } from "@heroui/react";
|
||||||
import { updateProfile } from "@/service/master-user";
|
import { updateProfile } from "@/services/master-user";
|
||||||
import { close, error, loading } from "@/config/swal";
|
import { close, error, loading } from "@/config/swal";
|
||||||
|
|
||||||
const formSchema = z.object({
|
const formSchema = z.object({
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import {
|
||||||
createCustomStaticPage,
|
createCustomStaticPage,
|
||||||
editCustomStaticPage,
|
editCustomStaticPage,
|
||||||
getCustomStaticDetail,
|
getCustomStaticDetail,
|
||||||
} from "@/service/static-page-service";
|
} from "@/services/static-page-service";
|
||||||
import { close, error, loading } from "@/config/swal";
|
import { close, error, loading } from "@/config/swal";
|
||||||
import Swal from "sweetalert2";
|
import Swal from "sweetalert2";
|
||||||
import withReactContent from "sweetalert2-react-content";
|
import withReactContent from "sweetalert2-react-content";
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import Image from "next/image";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { ChevronLeftWhite, ChevronRightIcon, EyeIcon } from "../icons";
|
import { ChevronLeftWhite, ChevronRightIcon, EyeIcon } from "../icons";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { getListArticle } from "@/service/article";
|
import { getListArticle } from "@/services/article";
|
||||||
import { convertDateFormat, textEllipsis } from "@/utils/global";
|
import { convertDateFormat, textEllipsis } from "@/utils/global";
|
||||||
import { Autoplay, Pagination, Navigation } from "swiper/modules";
|
import { Autoplay, Pagination, Navigation } from "swiper/modules";
|
||||||
import { Swiper, SwiperSlide } from "swiper/react";
|
import { Swiper, SwiperSlide } from "swiper/react";
|
||||||
|
|
@ -12,7 +12,7 @@ import "swiper/css";
|
||||||
import "swiper/css/pagination";
|
import "swiper/css/pagination";
|
||||||
import "swiper/css/effect-fade";
|
import "swiper/css/effect-fade";
|
||||||
import "swiper/css/navigation";
|
import "swiper/css/navigation";
|
||||||
import { getListMagazine } from "@/service/magazine";
|
import { getListMagazine } from "@/services/magazine";
|
||||||
|
|
||||||
export default function ENewsPolri() {
|
export default function ENewsPolri() {
|
||||||
const [article, setArticle] = useState<any>([]);
|
const [article, setArticle] = useState<any>([]);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import { Autoplay, Pagination, Navigation, Controller } from "swiper/modules";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import GPRKominfo from "../ui/social-media/gpr-kominfo";
|
import GPRKominfo from "../ui/social-media/gpr-kominfo";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { getListArticle } from "@/service/article";
|
import { getListArticle } from "@/services/article";
|
||||||
import { convertDateFormat, textEllipsis } from "@/utils/global";
|
import { convertDateFormat, textEllipsis } from "@/utils/global";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import { data } from "autoprefixer";
|
import { data } from "autoprefixer";
|
||||||
|
|
|
||||||
|
|
@ -13,14 +13,14 @@ import "swiper/css";
|
||||||
import "swiper/css/navigation";
|
import "swiper/css/navigation";
|
||||||
import "swiper/css/pagination";
|
import "swiper/css/pagination";
|
||||||
import { Navigation, Pagination } from "swiper/modules";
|
import { Navigation, Pagination } from "swiper/modules";
|
||||||
import { topNewsMediahub } from "@/service/medol-news-update";
|
import { topNewsMediahub } from "@/services/medol-news-update";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import {
|
import {
|
||||||
getImageInp,
|
getImageInp,
|
||||||
inpLogin,
|
inpLogin,
|
||||||
topNewsInp,
|
topNewsInp,
|
||||||
topNewsTbn,
|
topNewsTbn,
|
||||||
} from "@/service/third-party-service";
|
} from "@/services/third-party-service";
|
||||||
import { convertDateFormatNoTime, textEllipsis } from "@/utils/global";
|
import { convertDateFormatNoTime, textEllipsis } from "@/utils/global";
|
||||||
import PolriTvWidget from "../ui/social-media/polri-tv";
|
import PolriTvWidget from "../ui/social-media/polri-tv";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { ChevronLeftIcon, ChevronRightIcon } from "../icons";
|
import { ChevronLeftIcon, ChevronRightIcon } from "../icons";
|
||||||
import { getListArticle } from "@/service/article";
|
import { getListArticle } from "@/services/article";
|
||||||
import { convertDateFormat, textEllipsis } from "@/utils/global";
|
import { convertDateFormat, textEllipsis } from "@/utils/global";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react";
|
||||||
import { EyeIcon } from "../icons";
|
import { EyeIcon } from "../icons";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { getListArticle } from "@/service/article";
|
import { getListArticle } from "@/services/article";
|
||||||
import { convertDateFormat } from "@/utils/global";
|
import { convertDateFormat } from "@/utils/global";
|
||||||
|
|
||||||
export default function SidebarNav() {
|
export default function SidebarNav() {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import "swiper/css/navigation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { Autoplay, Pagination, Navigation, Controller } from "swiper/modules";
|
import { Autoplay, Pagination, Navigation, Controller } from "swiper/modules";
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { getAdvertise } from "@/service/advertisement";
|
import { getAdvertise } from "@/services/advertisement";
|
||||||
import VideoPlayer from "../player/video-player";
|
import VideoPlayer from "../player/video-player";
|
||||||
|
|
||||||
interface Jumbotron {
|
interface Jumbotron {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ import {
|
||||||
import storedLanguage from "@/store/language-store";
|
import storedLanguage from "@/store/language-store";
|
||||||
import { ThemeSwitch } from "../theme-switch";
|
import { ThemeSwitch } from "../theme-switch";
|
||||||
import { siteConfig, SiteConfig } from "@/config/site";
|
import { siteConfig, SiteConfig } from "@/config/site";
|
||||||
import { getAdvertise } from "@/service/advertisement";
|
import { getAdvertise } from "@/services/advertisement";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
|
||||||
const images = [
|
const images = [
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import { ChevronDownIcon, LandingAnalyticIcon, UserIcon } from "../icons";
|
||||||
import { MasterUsersIcon } from "../icons/sidebar-icon";
|
import { MasterUsersIcon } from "../icons/sidebar-icon";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { getActivity } from "@/service/activity-log";
|
import { getActivity } from "@/services/activity-log";
|
||||||
|
|
||||||
interface Activity {
|
interface Activity {
|
||||||
totalVisitorAllTime: number;
|
totalVisitorAllTime: number;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import { useTranslations } from "next-intl";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { error, success } from "@/config/swal";
|
import { error, success } from "@/config/swal";
|
||||||
import { subscription } from "@/service/subscribe";
|
import { subscription } from "@/services/subscribe";
|
||||||
|
|
||||||
export default function FooterNew(props: { margin?: boolean }) {
|
export default function FooterNew(props: { margin?: boolean }) {
|
||||||
const [emailValue, setEmailValue] = useState("");
|
const [emailValue, setEmailValue] = useState("");
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,14 @@ import "swiper/css";
|
||||||
import "swiper/css/navigation";
|
import "swiper/css/navigation";
|
||||||
import "swiper/css/pagination";
|
import "swiper/css/pagination";
|
||||||
import { Navigation, Pagination } from "swiper/modules";
|
import { Navigation, Pagination } from "swiper/modules";
|
||||||
import { topNewsMediahub } from "@/service/medol-news-update";
|
import { topNewsMediahub } from "@/services/medol-news-update";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import {
|
import {
|
||||||
getImageInp,
|
getImageInp,
|
||||||
inpLogin,
|
inpLogin,
|
||||||
topNewsInp,
|
topNewsInp,
|
||||||
topNewsTbn,
|
topNewsTbn,
|
||||||
} from "@/service/third-party-service";
|
} from "@/services/third-party-service";
|
||||||
import { convertDateFormatNoTime, textEllipsis } from "@/utils/global";
|
import { convertDateFormatNoTime, textEllipsis } from "@/utils/global";
|
||||||
import PolriTvWidget from "../ui/social-media/polri-tv";
|
import PolriTvWidget from "../ui/social-media/polri-tv";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,10 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
import { close, error, loading } from "@/config/swal";
|
import { close, error, loading } from "@/config/swal";
|
||||||
import OTPInput from "react-otp-input";
|
import OTPInput from "react-otp-input";
|
||||||
import { otpRequest, otpValidation } from "@/service/master-user";
|
import { otpRequest, otpValidation } from "@/services/master-user";
|
||||||
import Swal from "sweetalert2";
|
import Swal from "sweetalert2";
|
||||||
import withReactContent from "sweetalert2-react-content";
|
import withReactContent from "sweetalert2-react-content";
|
||||||
import { createFeedback } from "@/service/feedbacks";
|
import { createFeedback } from "@/services/feedbacks";
|
||||||
|
|
||||||
const createArticleSchema = z.object({
|
const createArticleSchema = z.object({
|
||||||
email: z.string().min(2, {
|
email: z.string().min(2, {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import React, { Component, useEffect, useState } from "react";
|
import React, { Component, useEffect, useState } from "react";
|
||||||
import ReactApexChart from "react-apexcharts";
|
import ReactApexChart from "react-apexcharts";
|
||||||
import dummyData from "../../../../const/dummy.json";
|
import dummyData from "../../../../const/dummy.json";
|
||||||
import { getStatisticMonthly } from "@/service/article";
|
import { getStatisticMonthly } from "@/services/article";
|
||||||
|
|
||||||
type WeekData = {
|
type WeekData = {
|
||||||
week: number;
|
week: number;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import dummyData from "../../../../const/dummy.json";
|
||||||
import {
|
import {
|
||||||
getStatisticMonthly,
|
getStatisticMonthly,
|
||||||
getStatisticMonthlyFeedback,
|
getStatisticMonthlyFeedback,
|
||||||
} from "@/service/article";
|
} from "@/services/article";
|
||||||
|
|
||||||
type WeekData = {
|
type WeekData = {
|
||||||
week: number;
|
week: number;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ import {
|
||||||
getStatisticSummary,
|
getStatisticSummary,
|
||||||
getTopArticles,
|
getTopArticles,
|
||||||
getUserLevelDataStat,
|
getUserLevelDataStat,
|
||||||
} from "@/service/article";
|
} from "@/services/article";
|
||||||
import { Article } from "@/types/globals";
|
import { Article } from "@/types/globals";
|
||||||
import {
|
import {
|
||||||
convertDateFormat,
|
convertDateFormat,
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import {
|
||||||
otpRequest,
|
otpRequest,
|
||||||
otpValidation,
|
otpValidation,
|
||||||
postArticleComment,
|
postArticleComment,
|
||||||
} from "@/service/master-user";
|
} from "@/services/master-user";
|
||||||
import { error } from "@/config/swal";
|
import { error } from "@/config/swal";
|
||||||
import { UserProfileIcon } from "@/components/icons/globals";
|
import { UserProfileIcon } from "@/components/icons/globals";
|
||||||
import { convertDateFormat } from "@/utils/global";
|
import { convertDateFormat } from "@/utils/global";
|
||||||
|
|
@ -20,7 +20,7 @@ import OTPInput from "react-otp-input";
|
||||||
import Swal from "sweetalert2";
|
import Swal from "sweetalert2";
|
||||||
import withReactContent from "sweetalert2-react-content";
|
import withReactContent from "sweetalert2-react-content";
|
||||||
import { SendIcon, TimesIcon } from "@/components/icons";
|
import { SendIcon, TimesIcon } from "@/components/icons";
|
||||||
import { saveActivity } from "@/service/activity-log";
|
import { saveActivity } from "@/services/activity-log";
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
|
|
||||||
const userId = Cookies.get("uie");
|
const userId = Cookies.get("uie");
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { ChevronRightIcon } from "@/components/icons";
|
import { ChevronRightIcon } from "@/components/icons";
|
||||||
import { close, loading } from "@/config/swal";
|
import { close, loading } from "@/config/swal";
|
||||||
import { getMagazineById } from "@/service/magazine";
|
import { getMagazineById } from "@/services/magazine";
|
||||||
import {
|
import {
|
||||||
convertDateFormat,
|
convertDateFormat,
|
||||||
formatMonthString,
|
formatMonthString,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import {
|
||||||
} from "../../icons";
|
} from "../../icons";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { getListArticle } from "@/service/article";
|
import { getListArticle } from "@/services/article";
|
||||||
import { formatMonthString, htmlToString, textEllipsis } from "@/utils/global";
|
import { formatMonthString, htmlToString, textEllipsis } from "@/utils/global";
|
||||||
import {
|
import {
|
||||||
useParams,
|
useParams,
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@ import DetailNews from "../../page/detail-news";
|
||||||
import SidebarDetail from "../../page/sidebar-detail";
|
import SidebarDetail from "../../page/sidebar-detail";
|
||||||
import RelatedNews from "../../page/related-news";
|
import RelatedNews from "../../page/related-news";
|
||||||
import Comment from "./comment";
|
import Comment from "./comment";
|
||||||
import { getArticleById, getListArticle } from "@/service/article";
|
import { getArticleById, getListArticle } from "@/services/article";
|
||||||
import { useParams, usePathname } from "next/navigation";
|
import { useParams, usePathname } from "next/navigation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { ChevronRightIcon, UserIcon } from "@/components/icons";
|
import { ChevronRightIcon, UserIcon } from "@/components/icons";
|
||||||
import { close, loading } from "@/config/swal";
|
import { close, loading } from "@/config/swal";
|
||||||
import { saveActivity } from "@/service/activity-log";
|
import { saveActivity } from "@/services/activity-log";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import DOMPurify from "dompurify";
|
||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
import * as z from "zod";
|
import * as z from "zod";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { createCustomStaticPage } from "@/service/static-page-service";
|
import { createCustomStaticPage } from "@/services/static-page-service";
|
||||||
import { close, error, loading } from "@/config/swal";
|
import { close, error, loading } from "@/config/swal";
|
||||||
import Swal from "sweetalert2";
|
import Swal from "sweetalert2";
|
||||||
import withReactContent from "sweetalert2-react-content";
|
import withReactContent from "sweetalert2-react-content";
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { image } from "@heroui/theme";
|
import { image } from "@heroui/theme";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import { saveActivity } from "@/service/activity-log";
|
import { saveActivity } from "@/services/activity-log";
|
||||||
|
|
||||||
const token = Cookies.get("access_token");
|
const token = Cookies.get("access_token");
|
||||||
const uid = Cookies.get("uie");
|
const uid = Cookies.get("uie");
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import { Card, CardBody, CardFooter, Image } from "@heroui/react";
|
import { Card, CardBody, CardFooter, Image } from "@heroui/react";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { EyeIcon, UnderLine } from "../icons";
|
import { EyeIcon, UnderLine } from "../icons";
|
||||||
import { getListArticle } from "@/service/article";
|
import { getListArticle } from "@/services/article";
|
||||||
import { Autoplay, Pagination, Navigation } from "swiper/modules";
|
import { Autoplay, Pagination, Navigation } from "swiper/modules";
|
||||||
import { Swiper, SwiperSlide } from "swiper/react";
|
import { Swiper, SwiperSlide } from "swiper/react";
|
||||||
import "swiper/css";
|
import "swiper/css";
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import "swiper/css";
|
||||||
import "swiper/css/effect-fade";
|
import "swiper/css/effect-fade";
|
||||||
import "swiper/css/pagination";
|
import "swiper/css/pagination";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { getListArticle } from "@/service/article";
|
import { getListArticle } from "@/services/article";
|
||||||
import { Card, CardFooter } from "@heroui/react";
|
import { Card, CardFooter } from "@heroui/react";
|
||||||
import { convertDateFormat, textEllipsis } from "@/utils/global";
|
import { convertDateFormat, textEllipsis } from "@/utils/global";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import {
|
||||||
deleteArticle,
|
deleteArticle,
|
||||||
getArticleByCategory,
|
getArticleByCategory,
|
||||||
getListArticle,
|
getListArticle,
|
||||||
} from "@/service/article";
|
} from "@/services/article";
|
||||||
import { Article } from "@/types/globals";
|
import { Article } from "@/types/globals";
|
||||||
import { convertDateFormat } from "@/utils/global";
|
import { convertDateFormat } from "@/utils/global";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
|
|
@ -64,7 +64,7 @@ import {
|
||||||
editAdvertise,
|
editAdvertise,
|
||||||
editAdvertiseIsActive,
|
editAdvertiseIsActive,
|
||||||
getAdvertise,
|
getAdvertise,
|
||||||
} from "@/service/advertisement";
|
} from "@/services/advertisement";
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ name: "No", uid: "no" },
|
{ name: "No", uid: "no" },
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import {
|
||||||
getArticleByCategory,
|
getArticleByCategory,
|
||||||
getListArticle,
|
getListArticle,
|
||||||
updateIsBannerArticle,
|
updateIsBannerArticle,
|
||||||
} from "@/service/article";
|
} from "@/services/article";
|
||||||
import { Article } from "@/types/globals";
|
import { Article } from "@/types/globals";
|
||||||
import { convertDateFormat } from "@/utils/global";
|
import { convertDateFormat } from "@/utils/global";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import {
|
||||||
getArticleByCategory,
|
getArticleByCategory,
|
||||||
getArticleById,
|
getArticleById,
|
||||||
getListArticle,
|
getListArticle,
|
||||||
} from "@/service/article";
|
} from "@/services/article";
|
||||||
import { Article } from "@/types/globals";
|
import { Article } from "@/types/globals";
|
||||||
import { convertDateFormat } from "@/utils/global";
|
import { convertDateFormat } from "@/utils/global";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
|
|
@ -57,7 +57,7 @@ import withReactContent from "sweetalert2-react-content";
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { getComments } from "@/service/comment";
|
import { getComments } from "@/services/comment";
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ name: "No", uid: "no" },
|
{ name: "No", uid: "no" },
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,9 @@ import { close, loading } from "@/config/swal";
|
||||||
import {
|
import {
|
||||||
getListArticleDraft,
|
getListArticleDraft,
|
||||||
getListTranscript,
|
getListTranscript,
|
||||||
} from "@/service/generate-article";
|
} from "@/services/generate-article";
|
||||||
import { textEllipsis } from "@/utils/global";
|
import { textEllipsis } from "@/utils/global";
|
||||||
import { getListArticle } from "@/service/article";
|
import { getListArticle } from "@/services/article";
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ name: "No", uid: "no" },
|
{ name: "No", uid: "no" },
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ import { SearchIcon, UserIcon } from "@/components/icons";
|
||||||
|
|
||||||
import { close, loading } from "@/config/swal";
|
import { close, loading } from "@/config/swal";
|
||||||
|
|
||||||
import { getListTranscript } from "@/service/generate-article";
|
import { getListTranscript } from "@/services/generate-article";
|
||||||
import { textEllipsis } from "@/utils/global";
|
import { textEllipsis } from "@/utils/global";
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ import {
|
||||||
deleteArticle,
|
deleteArticle,
|
||||||
getArticleByCategory,
|
getArticleByCategory,
|
||||||
getListArticle,
|
getListArticle,
|
||||||
} from "@/service/article";
|
} from "@/services/article";
|
||||||
import { deleteMagazine, getListMagazine } from "@/service/magazine";
|
import { deleteMagazine, getListMagazine } from "@/services/magazine";
|
||||||
import { Article } from "@/types/globals";
|
import { Article } from "@/types/globals";
|
||||||
import { convertDateFormat } from "@/utils/global";
|
import { convertDateFormat } from "@/utils/global";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
|
|
|
||||||
|
|
@ -13,13 +13,13 @@ import {
|
||||||
getArticleByCategory,
|
getArticleByCategory,
|
||||||
getCategoryPagination,
|
getCategoryPagination,
|
||||||
getListArticle,
|
getListArticle,
|
||||||
} from "@/service/article";
|
} from "@/services/article";
|
||||||
import {
|
import {
|
||||||
deleteCategory,
|
deleteCategory,
|
||||||
getCategoryById,
|
getCategoryById,
|
||||||
updateCategory,
|
updateCategory,
|
||||||
uploadCategoryThumbnail,
|
uploadCategoryThumbnail,
|
||||||
} from "@/service/master-categories";
|
} from "@/services/master-categories";
|
||||||
import { Article } from "@/types/globals";
|
import { Article } from "@/types/globals";
|
||||||
import { convertDateFormat } from "@/utils/global";
|
import { convertDateFormat } from "@/utils/global";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,11 @@ import {
|
||||||
EyeIconMdi,
|
EyeIconMdi,
|
||||||
} from "@/components/icons";
|
} from "@/components/icons";
|
||||||
import { error } from "@/config/swal";
|
import { error } from "@/config/swal";
|
||||||
import { deleteMasterUser } from "@/service/master-user";
|
import { deleteMasterUser } from "@/services/master-user";
|
||||||
import { deleteMasterUserRole, listUserRole } from "@/service/master-user-role";
|
import {
|
||||||
|
deleteMasterUserRole,
|
||||||
|
listUserRole,
|
||||||
|
} from "@/services/master-user-role";
|
||||||
import { MasterUser, MasterUserRole } from "@/types/globals";
|
import { MasterUser, MasterUserRole } from "@/types/globals";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ import {
|
||||||
EyeIconMdi,
|
EyeIconMdi,
|
||||||
} from "@/components/icons";
|
} from "@/components/icons";
|
||||||
import { error, success } from "@/config/swal";
|
import { error, success } from "@/config/swal";
|
||||||
import { deleteArticle, getListArticle } from "@/service/article";
|
import { deleteArticle, getListArticle } from "@/services/article";
|
||||||
import { deleteMasterUser, listMasterUsers } from "@/service/master-user";
|
import { deleteMasterUser, listMasterUsers } from "@/services/master-user";
|
||||||
import { Article, MasterUser } from "@/types/globals";
|
import { Article, MasterUser } from "@/types/globals";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import {
|
||||||
createUserLevel,
|
createUserLevel,
|
||||||
editUserLevel,
|
editUserLevel,
|
||||||
getUserLevel,
|
getUserLevel,
|
||||||
} from "@/service/master-user-level";
|
} from "@/services/master-user-level";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
import { RootRaws } from "postcss/lib/root";
|
import { RootRaws } from "postcss/lib/root";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ import {
|
||||||
SearchIcon,
|
SearchIcon,
|
||||||
} from "@/components/icons";
|
} from "@/components/icons";
|
||||||
import { error, success } from "@/config/swal";
|
import { error, success } from "@/config/swal";
|
||||||
import { deleteArticle, getListArticle } from "@/service/article";
|
import { deleteArticle, getListArticle } from "@/services/article";
|
||||||
import { getCustomStaticPage } from "@/service/static-page-service";
|
import { getCustomStaticPage } from "@/services/static-page-service";
|
||||||
import { Article } from "@/types/globals";
|
import { Article } from "@/types/globals";
|
||||||
import { convertDateFormat } from "@/utils/global";
|
import { convertDateFormat } from "@/utils/global";
|
||||||
import { Button } from "@heroui/button";
|
import { Button } from "@heroui/button";
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import {
|
||||||
deleteArticle,
|
deleteArticle,
|
||||||
getArticleByCategory,
|
getArticleByCategory,
|
||||||
getListArticle,
|
getListArticle,
|
||||||
} from "@/service/article";
|
} from "@/services/article";
|
||||||
import { Article } from "@/types/globals";
|
import { Article } from "@/types/globals";
|
||||||
import {
|
import {
|
||||||
convertDateFormat,
|
convertDateFormat,
|
||||||
|
|
@ -70,7 +70,7 @@ import {
|
||||||
deleteFeedback,
|
deleteFeedback,
|
||||||
getFeedbacks,
|
getFeedbacks,
|
||||||
getFeedbacksById,
|
getFeedbacksById,
|
||||||
} from "@/service/feedbacks";
|
} from "@/services/feedbacks";
|
||||||
import * as XLSX from "xlsx";
|
import * as XLSX from "xlsx";
|
||||||
import {
|
import {
|
||||||
Document,
|
Document,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import {
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import SidebarNav from "../landing/SidebarNav";
|
import SidebarNav from "../landing/SidebarNav";
|
||||||
import { ChevronRightIcon, EyeFilledIcon, SearchIcon } from "../icons";
|
import { ChevronRightIcon, EyeFilledIcon, SearchIcon } from "../icons";
|
||||||
import { getListMagazine } from "@/service/magazine";
|
import { getListMagazine } from "@/services/magazine";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import Datepicker from "react-tailwindcss-datepicker";
|
import Datepicker from "react-tailwindcss-datepicker";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { facebookHumasData } from "@/service/generate-article";
|
import { facebookHumasData } from "@/services/generate-article";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { tiktokHumasData } from "@/service/generate-article";
|
import { tiktokHumasData } from "@/services/generate-article";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import axiosInterceptorInstance from "@/services/http-config/axios-interceptor-instance";
|
import axiosInterceptorInstance from "@/services/http-config/axios-interceptor-instance";
|
||||||
import { getCsrfToken } from "../master-user";
|
import { getCsrfToken } from "../master-user";
|
||||||
import axiosBaseInstance from "./http-base-service";
|
import axiosBaseInstance from "./http-base-instance";
|
||||||
import mediahubBaseInstance from "./mediahub-base-service";
|
import mediahubBaseInstance from "./mediahub-base-service";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
|
|
||||||
|
|
@ -6,7 +6,7 @@ import {
|
||||||
httpPut,
|
httpPut,
|
||||||
} from "./http-config/axios-base-service";
|
} from "./http-config/axios-base-service";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import axiosBaseInstance from "./http-config/http-base-service";
|
import axiosBaseInstance from "./http-config/http-base-instance";
|
||||||
|
|
||||||
const token = Cookies.get("access_token");
|
const token = Cookies.get("access_token");
|
||||||
const id = Cookies.get("uie");
|
const id = Cookies.get("uie");
|
||||||
|
|
@ -3,7 +3,7 @@ import {
|
||||||
httpGet,
|
httpGet,
|
||||||
httpPost,
|
httpPost,
|
||||||
httpPut,
|
httpPut,
|
||||||
} from "@/service/http-config/axios-base-service";
|
} from "@/services/http-config/axios-base-service";
|
||||||
|
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,9 @@ main {
|
||||||
|
|
||||||
.swal2-confirm {
|
.swal2-confirm {
|
||||||
background-color: #4275f5 !important;
|
background-color: #4275f5 !important;
|
||||||
|
color: white !important;
|
||||||
}
|
}
|
||||||
.swal2-cancel {
|
.swal2-cancel {
|
||||||
background-color: #d33 !important;
|
background-color: #d33 !important;
|
||||||
|
color: white !important;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue