fix: .env
This commit is contained in:
parent
1dfb8d49a9
commit
26b2f51787
2
.env
2
.env
|
|
@ -1,2 +1,2 @@
|
|||
NETIDHUB_CLIENT_KEY=b1ce6602-07ad-46c2-85eb-0cd6decfefa3
|
||||
NEXT_PUBLIC_API_URL=http://kontenhumas.com/api
|
||||
NEXT_PUBLIC_API_URL=https://kontenhumas.com/api
|
||||
|
|
@ -199,6 +199,16 @@ export default function MediaUpdate() {
|
|||
const typeId = parseInt(getTypeIdByContentType(contentType));
|
||||
setCurrentTypeId(typeId.toString());
|
||||
|
||||
// const response = await listArticles(
|
||||
// 1,
|
||||
// 10,
|
||||
// typeId,
|
||||
// undefined,
|
||||
// undefined,
|
||||
// section === "latest" ? "createdAt" : "viewCount",
|
||||
// slug
|
||||
// );
|
||||
|
||||
const response = await listArticles(
|
||||
1,
|
||||
10,
|
||||
|
|
@ -206,13 +216,13 @@ export default function MediaUpdate() {
|
|||
undefined,
|
||||
undefined,
|
||||
section === "latest" ? "createdAt" : "viewCount",
|
||||
slug
|
||||
slug || undefined, // ⬅️ jangan kirim undefined string
|
||||
);
|
||||
|
||||
let hasil: any[] = [];
|
||||
|
||||
if (response?.error) {
|
||||
console.error("Articles API failed, fallback ke old API");
|
||||
// console.error("Articles API failed, fallback ke old API");
|
||||
const fallbackRes = await listData(
|
||||
typeId.toString(),
|
||||
"",
|
||||
|
|
@ -221,7 +231,7 @@ export default function MediaUpdate() {
|
|||
0,
|
||||
"",
|
||||
"",
|
||||
""
|
||||
"",
|
||||
);
|
||||
hasil = fallbackRes?.data?.data?.content || [];
|
||||
} else {
|
||||
|
|
@ -263,14 +273,14 @@ export default function MediaUpdate() {
|
|||
const ids = new Set<number>(
|
||||
(Array.isArray(bookmarks) ? bookmarks : [])
|
||||
.map((b: any) => Number(b.articleId ?? b.id ?? b.article?.id))
|
||||
.filter((x) => !isNaN(x))
|
||||
.filter((x) => !isNaN(x)),
|
||||
);
|
||||
|
||||
const gabungan = new Set([...localSet, ...ids]);
|
||||
setBookmarkedIds(gabungan);
|
||||
localStorage.setItem(
|
||||
"bookmarkedIds",
|
||||
JSON.stringify(Array.from(gabungan))
|
||||
JSON.stringify(Array.from(gabungan)),
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
|
|
@ -308,7 +318,7 @@ export default function MediaUpdate() {
|
|||
setBookmarkedIds(updated);
|
||||
localStorage.setItem(
|
||||
"bookmarkedIds",
|
||||
JSON.stringify(Array.from(updated))
|
||||
JSON.stringify(Array.from(updated)),
|
||||
);
|
||||
|
||||
MySwal.fire({
|
||||
|
|
|
|||
Loading…
Reference in New Issue