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