change endpoint api

This commit is contained in:
Sabda Yagra 2025-07-19 22:37:18 +07:00
parent b3ab21700a
commit 3ed1327707
21 changed files with 183 additions and 183 deletions

2
.env
View File

@ -1,3 +1,3 @@
NEXT_PUBLIC_API=https://mediahub.polri.go.id/api
NEXT_PUBLIC_API=https://mediahub.polri.go.id/api/v2
NEXT_PUBLIC=https://mediahub.polri.go.id
NEXT_PUBLIC_TINYMCE_API_KEY=bhteuja26yz5p0aubxry9b95hs33amgn65kjv5km0fd5iuev

View File

@ -128,7 +128,7 @@ const useTableColumns = ({
try {
loading();
const response = await axios.get(
`https://mediahub.polri.go.id/api/media/report/download?id=${id}`,
`https://mediahub.polri.go.id/api/v2/media/report/download?id=${id}`,
{
responseType: "blob",
}

View File

@ -108,7 +108,7 @@ const ReportTable = () => {
const [previewData, setPreviewData] = React.useState<any>(null);
const handlePreview = (id: string) => {
const url = `https://mediahub.polri.go.id/api/media/report/view?id=${id}`;
const url = `https://mediahub.polri.go.id/api/v2/media/report/view?id=${id}`;
setPreviewData({ url });
setOpenPreview(true);
};

View File

@ -85,7 +85,7 @@ const LatestNews = (props: { type: string }) => {
// useEffect(() => {
// async function fetchCategories() {
// const url = "https://mediahub.polri.go.id/api/csrf";
// const url = "https://mediahub.polri.go.id/api/v2/csrf";
// try {
// const response = await fetch(url);

View File

@ -82,7 +82,7 @@ const NationalNews = () => {
// useEffect(() => {
// async function fetchCategories() {
// const url = "https://mediahub.polri.go.id/api/csrf";
// const url = "https://mediahub.polri.go.id/api/v2/csrf";
// try {
// const response = await fetch(url);

View File

@ -23,7 +23,7 @@ const PopularNews = () => {
useEffect(() => {
async function fetchCategories() {
const url = "https://mediahub.polri.go.id/api/csrf";
const url = "https://mediahub.polri.go.id/api/v2/csrf";
try {
const response = await fetch(url);

View File

@ -75,7 +75,7 @@ const RegionalNews = () => {
// useEffect(() => {
// async function fetchCategories() {
// const url = "https://mediahub.polri.go.id/api/csrf";
// const url = "https://mediahub.polri.go.id/api/v2/csrf";
// try {
// const response = await fetch(url);

View File

@ -526,7 +526,7 @@ export function TambahIklanDetail() {
</p>
<Image
src={`https://mediahub.polri.go.id/api/advertisements/viewer/${id}`}
src={`https://mediahub.polri.go.id/api/v2/advertisements/viewer/${id}`}
alt="Thumbnail Gambar Utama"
className=" rounded-md my-3"
width={300}

View File

@ -510,7 +510,7 @@ export function TambahIklanUpdate() {
))}
<Image
src={`https://mediahub.polri.go.id/api/advertisements/viewer/${id}`}
src={`https://mediahub.polri.go.id/api/v2/advertisements/viewer/${id}`}
alt="Thumbnail Gambar Utama"
className=" rounded-md my-3"
width={300}

View File

@ -39,7 +39,7 @@ const HeroModal = ({ onClose, group, poldaName, satkerName }: HeroModalProps) =>
useEffect(() => {
async function fetchCategories() {
const url = "https://mediahub.polri.go.id/api/csrf";
const url = "https://mediahub.polri.go.id/api/v2/csrf";
try {
const response = await fetch(url);

View File

@ -50,7 +50,7 @@ const HeroModal = ({ onClose }: { onClose: () => void }) => {
useEffect(() => {
async function fetchCategories() {
const url = "https://mediahub.polri.go.id/api/csrf";
const url = "https://mediahub.polri.go.id/api/v2/csrf";
try {
const response = await fetch(url);
@ -268,7 +268,7 @@ const Hero = (props: { group?: string }) => {
useEffect(() => {
async function fetchCategories() {
const url = "https://mediahub.polri.go.id/api/csrf";
const url = "https://mediahub.polri.go.id/api/v2/csrf";
try {
const response = await fetch(url);

View File

@ -36,7 +36,7 @@ const ScrollableContentPolda = () => {
useEffect(() => {
async function fetchCategories() {
const url = "https://mediahub.polri.go.id/api/csrf";
const url = "https://mediahub.polri.go.id/api/v2/csrf";
try {
const response = await fetch(url);

View File

@ -35,7 +35,7 @@ const ScrollableContentSatker = () => {
: "";
useEffect(() => {
async function fetchCategories() {
const url = "https://mediahub.polri.go.id/api/csrf";
const url = "https://mediahub.polri.go.id/api/v2/csrf";
try {
const response = await fetch(url);

View File

@ -40,7 +40,7 @@ const ScrollableContent = () => {
useEffect(() => {
async function fetchCategories() {
const url = "https://mediahub.polri.go.id/api/csrf";
const url = "https://mediahub.polri.go.id/api/v2/csrf";
try {
const response = await fetch(url);

File diff suppressed because it is too large Load Diff

View File

@ -45,7 +45,7 @@ export async function getCsrfToken() {
"content-type": "application/json",
};
return httpGet(pathUrl, headers);
// const url = 'https://mediahub.polri.go.id/api/csrf';
// const url = 'https://mediahub.polri.go.id/api/v2/csrf';
// try {
// const response = await fetch(url, {
// method: 'GET',

View File

@ -1,6 +1,6 @@
import axios from "axios";
const baseURL = "https://mediahub.polri.go.id/api/";
const baseURL = "https://mediahub.polri.go.id/api/v2/";
const axiosBaseInstance = axios.create({
baseURL,

View File

@ -1,6 +1,6 @@
import axios from "axios";
const baseURL = "https://mediahub.polri.go.id/api/";
const baseURL = "https://mediahub.polri.go.id/api/v2/";
const axiosBaseProdInstance = axios.create({
baseURL,

View File

@ -2,7 +2,7 @@ import axios from "axios";
import Cookies from "js-cookie";
import { getCsrfToken, login } from "../auth";
const baseURL = "https://mediahub.polri.go.id/api/";
const baseURL = "https://mediahub.polri.go.id/api/v2/";
const refreshToken = Cookies.get("refresh_token");

View File

@ -1,6 +1,6 @@
import axios from "axios";
const baseURL = "https://mediahub.polri.go.id/api/";
const baseURL = "https://mediahub.polri.go.id/api/v2/";
const axiosInstanceJson = axios.create({
baseURL,

View File

@ -12,7 +12,7 @@ export async function getCsrfToken() {
"content-type": "application/json",
};
return httpGet(pathUrl, headers);
// const url = 'https://mediahub.polri.go.id/api/csrf';
// const url = 'https://mediahub.polri.go.id/api/v2/csrf';
// try {
// const response = await fetch(url, {
// method: 'GET',