From eb77a23bc97d86ff41fbc50f9f7945a57d817b2e Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Fri, 27 Feb 2026 09:05:55 +0700 Subject: [PATCH] feat:timestamp for detail --- components/form/article/edit-article-form.tsx | 2 +- services/article.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/form/article/edit-article-form.tsx b/components/form/article/edit-article-form.tsx index 9628d46..ac6502b 100644 --- a/components/form/article/edit-article-form.tsx +++ b/components/form/article/edit-article-form.tsx @@ -221,7 +221,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) { async function initState() { loading(); - const res = await getArticleById(id); + const res = await getArticleById(id, getUnixTimestamp()); const data = res.data?.data; setDetailData(data); setValue("title", data?.title); diff --git a/services/article.ts b/services/article.ts index d835fec..71ee1b1 100644 --- a/services/article.ts +++ b/services/article.ts @@ -120,11 +120,11 @@ export async function updateArticle(id: string, data: any) { return await httpPut(pathUrl, headers, data); } -export async function getArticleById(id: any) { +export async function getArticleById(id: any, timeStamp: any) { const headers = { "content-type": "application/json", }; - return await httpGet(`/articles/${id}`, headers); + return await httpGet(`/articles/${id}?timeStamp=${timeStamp}`, headers); } export async function getRecapArticleData(data: any) { const headers = {