remove time stamp
This commit is contained in:
parent
4c807a7fee
commit
6e071f170f
|
|
@ -110,7 +110,7 @@ const sidebarLevel3 = [
|
|||
name: "Artikel",
|
||||
moduleId: 652,
|
||||
moduleName: "Dashboard",
|
||||
modulePathUrl: `/admin/article?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/article `,
|
||||
parentId: -1,
|
||||
icon: <ArticleIcon size={24} />,
|
||||
position: 1,
|
||||
|
|
@ -124,7 +124,7 @@ const sidebarLevel3 = [
|
|||
name: "Kategori",
|
||||
moduleId: 654,
|
||||
moduleName: "Master",
|
||||
modulePathUrl: `/admin/master-category?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/master-category `,
|
||||
parentId: -1,
|
||||
icon: <MasterCategoryIcon size={22} />,
|
||||
position: 1,
|
||||
|
|
@ -185,7 +185,7 @@ const sidebarLevel2 = [
|
|||
name: "Artikel",
|
||||
moduleId: 652,
|
||||
moduleName: "Dashboard",
|
||||
modulePathUrl: `/admin/article?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/article `,
|
||||
parentId: -1,
|
||||
icon: <ArticleIcon size={24} />,
|
||||
position: 1,
|
||||
|
|
@ -199,7 +199,7 @@ const sidebarLevel2 = [
|
|||
name: "Kategori",
|
||||
moduleId: 654,
|
||||
moduleName: "Master",
|
||||
modulePathUrl: `/admin/master-category?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/master-category `,
|
||||
parentId: -1,
|
||||
icon: <MasterCategoryIcon size={22} />,
|
||||
position: 1,
|
||||
|
|
@ -702,7 +702,7 @@ const SidebarMobile: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl
|
||||
list.modulePathUrl,
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
|
|
@ -710,7 +710,7 @@ const SidebarMobile: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
)),
|
||||
]}
|
||||
/>
|
||||
)
|
||||
),
|
||||
)
|
||||
: rolesId === "2"
|
||||
? sidebarLevel2?.map((list: any, index: number) =>
|
||||
|
|
@ -770,7 +770,7 @@ const SidebarMobile: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl
|
||||
list.modulePathUrl,
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
|
|
@ -778,7 +778,7 @@ const SidebarMobile: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
)),
|
||||
]}
|
||||
/>
|
||||
)
|
||||
),
|
||||
)
|
||||
: sidebarLevel3?.map((list: any, index: number) =>
|
||||
list.isGroup ? (
|
||||
|
|
@ -837,7 +837,7 @@ const SidebarMobile: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl
|
||||
list.modulePathUrl,
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
|
|
@ -845,7 +845,7 @@ const SidebarMobile: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
)),
|
||||
]}
|
||||
/>
|
||||
)
|
||||
),
|
||||
)}
|
||||
</SidebarMenu>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,11 @@ import { SidebarMenu } from "./sidebar-menu";
|
|||
import Image from "next/image";
|
||||
import Cookies from "js-cookie";
|
||||
import { SettingsIcon, UserProfileIcon } from "@/components/icons/globals";
|
||||
import { getCookiesDecrypt, getUnixTimestamp, textEllipsis } from "@/utils/global";
|
||||
import {
|
||||
getCookiesDecrypt,
|
||||
getUnixTimestamp,
|
||||
textEllipsis,
|
||||
} from "@/utils/global";
|
||||
|
||||
interface SubMenuItems {
|
||||
id: number;
|
||||
|
|
@ -110,7 +114,7 @@ const sidebarLevel3 = [
|
|||
name: "Artikel",
|
||||
moduleId: 652,
|
||||
moduleName: "Dashboard",
|
||||
modulePathUrl: `/admin/article?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/article `,
|
||||
parentId: -1,
|
||||
icon: <ArticleIcon size={24} />,
|
||||
position: 1,
|
||||
|
|
@ -124,7 +128,7 @@ const sidebarLevel3 = [
|
|||
name: "Kategori",
|
||||
moduleId: 654,
|
||||
moduleName: "Master",
|
||||
modulePathUrl: `/admin/master-category?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/master-category `,
|
||||
parentId: -1,
|
||||
icon: <MasterCategoryIcon size={22} />,
|
||||
position: 1,
|
||||
|
|
@ -375,7 +379,7 @@ const sidebarLevel1 = [
|
|||
name: "Artikel",
|
||||
moduleId: 652,
|
||||
moduleName: "Dashboard",
|
||||
modulePathUrl: `/admin/article?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/article `,
|
||||
parentId: -1,
|
||||
icon: <ArticleIcon size={24} />,
|
||||
position: 1,
|
||||
|
|
@ -389,7 +393,7 @@ const sidebarLevel1 = [
|
|||
name: "Kategori",
|
||||
moduleId: 654,
|
||||
moduleName: "Master",
|
||||
modulePathUrl: `/admin/master-category?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/master-category `,
|
||||
parentId: -1,
|
||||
icon: <MasterCategoryIcon size={22} />,
|
||||
position: 1,
|
||||
|
|
@ -709,7 +713,7 @@ const Sidebar: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl
|
||||
list.modulePathUrl,
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
|
|
@ -717,7 +721,7 @@ const Sidebar: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
)),
|
||||
]}
|
||||
/>
|
||||
)
|
||||
),
|
||||
)
|
||||
: rolesId === "2"
|
||||
? sidebarLevel2?.map((list: any, index: number) =>
|
||||
|
|
@ -784,7 +788,7 @@ const Sidebar: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl
|
||||
list.modulePathUrl,
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
|
|
@ -792,7 +796,7 @@ const Sidebar: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
)),
|
||||
]}
|
||||
/>
|
||||
)
|
||||
),
|
||||
)
|
||||
: sidebarLevel3?.map((list: any, index: number) =>
|
||||
list.isGroup ? (
|
||||
|
|
@ -858,7 +862,7 @@ const Sidebar: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl
|
||||
list.modulePathUrl,
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
|
|
@ -866,7 +870,7 @@ const Sidebar: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
)),
|
||||
]}
|
||||
/>
|
||||
)
|
||||
),
|
||||
)}
|
||||
</SidebarMenu>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -161,8 +161,6 @@ export default function ArticleTable() {
|
|||
}
|
||||
});
|
||||
|
||||
current.set("timeStamp", String(getUnixTimestamp()));
|
||||
|
||||
router.push(`?${current.toString()}`);
|
||||
};
|
||||
|
||||
|
|
@ -279,7 +277,6 @@ export default function ArticleTable() {
|
|||
createdByIds: searchParams.get("createdByIds") || "",
|
||||
sort: "desc",
|
||||
sortBy: "created_at",
|
||||
timeStamp: searchParams.get("timeStamp") || getUnixTimestamp(),
|
||||
};
|
||||
const res = await getListArticleAdminPage(req);
|
||||
await getTableNumber(parseInt(showData), res.data?.data);
|
||||
|
|
|
|||
|
|
@ -30,9 +30,7 @@ export async function getAdvertise(data: any) {
|
|||
};
|
||||
const pathUrl = `/advertisement?page=${data?.page || 1}&limit=${
|
||||
data?.limit || ""
|
||||
}&placement=${data?.placement || ""}&isPublish=${
|
||||
data.isPublish || ""
|
||||
}&timeStamp=${data.timeStamp || ""}`;
|
||||
}&placement=${data?.placement || ""}&isPublish=${data.isPublish || ""}`;
|
||||
return await httpGet(pathUrl, headers);
|
||||
}
|
||||
|
||||
|
|
@ -42,9 +40,7 @@ export async function getAdvertiseAdmin(data: any) {
|
|||
};
|
||||
const pathUrl = `/advertisement?page=${data?.page || 1}&limit=${
|
||||
data?.limit || ""
|
||||
}&placement=${data?.placement || ""}&isPublish=${
|
||||
data.isPublish || ""
|
||||
}&timeStamp=${data.timeStamp || ""}`;
|
||||
}&placement=${data?.placement || ""}&isPublish=${data.isPublish || ""}`;
|
||||
return await httpGetInterceptor(pathUrl);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export async function getListArticle(props: PaginationRequest) {
|
|||
sort || "desc"
|
||||
}&category=${categorySlug || ""}&isBanner=${isBanner || ""}&categoryIds=${
|
||||
categoryIds || ""
|
||||
}&createdByIds=${createdByIds || ""}&isPolda=${isPolda || ""}&timeStamp=${timeStamp || ""}`,
|
||||
}&createdByIds=${createdByIds || ""}&isPolda=${isPolda || ""}`,
|
||||
headers,
|
||||
);
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@ export async function getListArticleAdminPage(props: any) {
|
|||
sort || "asc"
|
||||
}&category=${categorySlug || ""}&isBanner=${isBanner || ""}&categoryIds=${
|
||||
categoryIds || ""
|
||||
}&createdByIds=${createdByIds || ""}&timeStamp=${timeStamp || ""}`,
|
||||
}&createdByIds=${createdByIds || ""}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -89,9 +89,7 @@ export async function getTopArticles(props: PaginationRequest) {
|
|||
isPublish === undefined ? "" : isPublish
|
||||
}&title=${search}&startDate=${startDate || ""}&endDate=${
|
||||
endDate || ""
|
||||
}&category=${category || ""}&sortBy=view_count&sort=desc&timeStamp=${
|
||||
timeStamp || ""
|
||||
}`,
|
||||
}&category=${category || ""}&sortBy=view_count&sort=desc`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -157,9 +155,7 @@ export async function getArticleByCategory(timeStamp: number) {
|
|||
"content-type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
return await httpGetInterceptor(
|
||||
`/article-categories?limit=1000&timeStamp=${timeStamp}`,
|
||||
);
|
||||
return await httpGetInterceptor(`/article-categories?limit=1000`);
|
||||
}
|
||||
export async function getCategoryPagination(data: any) {
|
||||
const headers = {
|
||||
|
|
@ -168,7 +164,7 @@ export async function getCategoryPagination(data: any) {
|
|||
};
|
||||
|
||||
return await httpGetInterceptor(
|
||||
`/article-categories?limit=${data?.limit}&page=${data?.page}&title=${data?.search}&timeStamp=${data.timeStamp}`,
|
||||
`/article-categories?limit=${data?.limit}&page=${data?.page}&title=${data?.search}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -217,7 +213,7 @@ export async function getUserLevelDataStat(
|
|||
return await httpGetInterceptor(
|
||||
`/articles/statistic/user-levels?startDate=${startDate}&endDate=${endDate}&startTime=${startTime}&endTime=${endTime}&levelType=${levelType}&userLevelId=${
|
||||
levelId || ""
|
||||
}&timeStamp=${timeStamp}`,
|
||||
}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -250,9 +246,7 @@ export async function getStatisticMonthly(year: string, timeStamp: number) {
|
|||
"content-type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
return await httpGetInterceptor(
|
||||
`/articles/statistic/monthly?year=${year}&timeStamp=${timeStamp}`,
|
||||
);
|
||||
return await httpGetInterceptor(`/articles/statistic/monthly?year=${year}`);
|
||||
}
|
||||
export async function getStatisticVisitorsMonthly(year: string) {
|
||||
const headers = {
|
||||
|
|
@ -282,19 +276,14 @@ export async function getStatisticMonthlyFeedback(
|
|||
"content-type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
return await httpGet(
|
||||
`/feedbacks/statistic/monthly?year=${year}&timeStamp=${timeStamp}`,
|
||||
headers,
|
||||
);
|
||||
return await httpGet(`/feedbacks/statistic/monthly?year=${year}`, headers);
|
||||
}
|
||||
export async function getStatisticSummary(timeStamp: number) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
return await httpGetInterceptor(
|
||||
`/articles/statistic/summary?timeStamp=${timeStamp}`,
|
||||
);
|
||||
return await httpGetInterceptor(`/articles/statistic/summary`);
|
||||
}
|
||||
|
||||
export async function submitApproval(data: {
|
||||
|
|
@ -327,7 +316,7 @@ export async function getArticleByCategoryLanding(props: {
|
|||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGet(
|
||||
`/article-categories?limit=${props.limit}&title=${props.title}&timeStamp=${props?.timeStamp}`,
|
||||
`/article-categories?limit=${props.limit}&title=${props.title}`,
|
||||
headers,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,7 @@ export async function getComments(data: any) {
|
|||
};
|
||||
const pathUrl = `/article-comments?page=${data?.page || 1}&limit=${
|
||||
data?.limit || ""
|
||||
}&message=${data?.search || ""}&parentId=0&timeStamp=${
|
||||
data?.timeStamp || ""
|
||||
}`;
|
||||
}&message=${data?.search || ""}&parentId=0`;
|
||||
return await httpGetInterceptor(pathUrl);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export async function getFeedbacks(data: any) {
|
|||
data?.limit || ""
|
||||
}&message=${data?.search || ""}&startDate=${data.startDate || ""}&endDate=${
|
||||
data.endDate || ""
|
||||
}&timeStamp=${data.timeStamp}`;
|
||||
}`;
|
||||
return await httpGetInterceptor(pathUrl);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ export async function getListMagazine(props: PaginationRequest) {
|
|||
return await httpGet(
|
||||
`/magazines?limit=${limit}&page=${page}&title=${search}&startDate=${
|
||||
startDate || ""
|
||||
}&endDate=${endDate || ""}&timeStamp=${timeStamp || ""}`,
|
||||
headers
|
||||
}&endDate=${endDate || ""}`,
|
||||
headers,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,7 @@ export async function listUserRole(data: any) {
|
|||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGetInterceptor(
|
||||
`/user-roles?limit=${data.limit}&page=${data.page}&timeStamp=${
|
||||
data.timeStamp || ""
|
||||
}`
|
||||
`/user-roles?limit=${data.limit}&page=${data.page}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,8 @@ export async function listMasterUsers(data: any) {
|
|||
return await httpGet(
|
||||
`/users?page=${data.page}&limit=${data.limit}&username=${
|
||||
data.username || ""
|
||||
}&fullname=${data.fullname || ""}&email=${data.email || ""}&timeStamp=${
|
||||
data.timeStamp || ""
|
||||
}`,
|
||||
headers
|
||||
}&fullname=${data.fullname || ""}&email=${data.email || ""}`,
|
||||
headers,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -174,7 +172,7 @@ export async function getArticleComment(id: string) {
|
|||
};
|
||||
return await httpGet(
|
||||
`/article-comments?isPublic=true&articleId=${id}`,
|
||||
headers
|
||||
headers,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export async function getCustomStaticPage(props: PaginationRequest) {
|
|||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGetInterceptor(
|
||||
`/custom-static-pages?limit=${limit}&page=${page}&title=${search}&timeStamp=${timeStamp}`
|
||||
`/custom-static-pages?limit=${limit}&page=${page}&title=${search}`,
|
||||
);
|
||||
}
|
||||
export async function getCustomStaticDetail(id: string) {
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@ export async function getAllUserLevels(data?: any) {
|
|||
return await httpGetInterceptor(
|
||||
`user-levels?limit=${data?.limit || ""}&levelNumber=${
|
||||
data?.levelNumber || ""
|
||||
}&name=${data?.search || ""}&page=${data?.page || "1"}&timeStamp=${
|
||||
data?.timeStamp || ""
|
||||
}`
|
||||
}&name=${data?.search || ""}&page=${data?.page || "1"}`,
|
||||
);
|
||||
}
|
||||
export async function getUserLevels(id: string) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue