change endpoint api
This commit is contained in:
parent
b3ab21700a
commit
3ed1327707
2
.env
2
.env
|
|
@ -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=https://mediahub.polri.go.id
|
||||||
NEXT_PUBLIC_TINYMCE_API_KEY=bhteuja26yz5p0aubxry9b95hs33amgn65kjv5km0fd5iuev
|
NEXT_PUBLIC_TINYMCE_API_KEY=bhteuja26yz5p0aubxry9b95hs33amgn65kjv5km0fd5iuev
|
||||||
|
|
@ -128,7 +128,7 @@ const useTableColumns = ({
|
||||||
try {
|
try {
|
||||||
loading();
|
loading();
|
||||||
const response = await axios.get(
|
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",
|
responseType: "blob",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ const ReportTable = () => {
|
||||||
const [previewData, setPreviewData] = React.useState<any>(null);
|
const [previewData, setPreviewData] = React.useState<any>(null);
|
||||||
|
|
||||||
const handlePreview = (id: string) => {
|
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 });
|
setPreviewData({ url });
|
||||||
setOpenPreview(true);
|
setOpenPreview(true);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ const LatestNews = (props: { type: string }) => {
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// async function fetchCategories() {
|
// async function fetchCategories() {
|
||||||
// const url = "https://mediahub.polri.go.id/api/csrf";
|
// const url = "https://mediahub.polri.go.id/api/v2/csrf";
|
||||||
|
|
||||||
// try {
|
// try {
|
||||||
// const response = await fetch(url);
|
// const response = await fetch(url);
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ const NationalNews = () => {
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// async function fetchCategories() {
|
// async function fetchCategories() {
|
||||||
// const url = "https://mediahub.polri.go.id/api/csrf";
|
// const url = "https://mediahub.polri.go.id/api/v2/csrf";
|
||||||
|
|
||||||
// try {
|
// try {
|
||||||
// const response = await fetch(url);
|
// const response = await fetch(url);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ const PopularNews = () => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchCategories() {
|
async function fetchCategories() {
|
||||||
const url = "https://mediahub.polri.go.id/api/csrf";
|
const url = "https://mediahub.polri.go.id/api/v2/csrf";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url);
|
const response = await fetch(url);
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ const RegionalNews = () => {
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// async function fetchCategories() {
|
// async function fetchCategories() {
|
||||||
// const url = "https://mediahub.polri.go.id/api/csrf";
|
// const url = "https://mediahub.polri.go.id/api/v2/csrf";
|
||||||
|
|
||||||
// try {
|
// try {
|
||||||
// const response = await fetch(url);
|
// const response = await fetch(url);
|
||||||
|
|
|
||||||
|
|
@ -526,7 +526,7 @@ export function TambahIklanDetail() {
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<Image
|
<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"
|
alt="Thumbnail Gambar Utama"
|
||||||
className=" rounded-md my-3"
|
className=" rounded-md my-3"
|
||||||
width={300}
|
width={300}
|
||||||
|
|
|
||||||
|
|
@ -510,7 +510,7 @@ export function TambahIklanUpdate() {
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<Image
|
<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"
|
alt="Thumbnail Gambar Utama"
|
||||||
className=" rounded-md my-3"
|
className=" rounded-md my-3"
|
||||||
width={300}
|
width={300}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ const HeroModal = ({ onClose, group, poldaName, satkerName }: HeroModalProps) =>
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchCategories() {
|
async function fetchCategories() {
|
||||||
const url = "https://mediahub.polri.go.id/api/csrf";
|
const url = "https://mediahub.polri.go.id/api/v2/csrf";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url);
|
const response = await fetch(url);
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ const HeroModal = ({ onClose }: { onClose: () => void }) => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchCategories() {
|
async function fetchCategories() {
|
||||||
const url = "https://mediahub.polri.go.id/api/csrf";
|
const url = "https://mediahub.polri.go.id/api/v2/csrf";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url);
|
const response = await fetch(url);
|
||||||
|
|
@ -268,7 +268,7 @@ const Hero = (props: { group?: string }) => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchCategories() {
|
async function fetchCategories() {
|
||||||
const url = "https://mediahub.polri.go.id/api/csrf";
|
const url = "https://mediahub.polri.go.id/api/v2/csrf";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url);
|
const response = await fetch(url);
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ const ScrollableContentPolda = () => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchCategories() {
|
async function fetchCategories() {
|
||||||
const url = "https://mediahub.polri.go.id/api/csrf";
|
const url = "https://mediahub.polri.go.id/api/v2/csrf";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url);
|
const response = await fetch(url);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ const ScrollableContentSatker = () => {
|
||||||
: "";
|
: "";
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchCategories() {
|
async function fetchCategories() {
|
||||||
const url = "https://mediahub.polri.go.id/api/csrf";
|
const url = "https://mediahub.polri.go.id/api/v2/csrf";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url);
|
const response = await fetch(url);
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ const ScrollableContent = () => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchCategories() {
|
async function fetchCategories() {
|
||||||
const url = "https://mediahub.polri.go.id/api/csrf";
|
const url = "https://mediahub.polri.go.id/api/v2/csrf";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url);
|
const response = await fetch(url);
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -45,7 +45,7 @@ export async function getCsrfToken() {
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
};
|
};
|
||||||
return httpGet(pathUrl, headers);
|
return httpGet(pathUrl, headers);
|
||||||
// const url = 'https://mediahub.polri.go.id/api/csrf';
|
// const url = 'https://mediahub.polri.go.id/api/v2/csrf';
|
||||||
// try {
|
// try {
|
||||||
// const response = await fetch(url, {
|
// const response = await fetch(url, {
|
||||||
// method: 'GET',
|
// method: 'GET',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import axios from "axios";
|
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({
|
const axiosBaseInstance = axios.create({
|
||||||
baseURL,
|
baseURL,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import axios from "axios";
|
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({
|
const axiosBaseProdInstance = axios.create({
|
||||||
baseURL,
|
baseURL,
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import axios from "axios";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import { getCsrfToken, login } from "../auth";
|
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");
|
const refreshToken = Cookies.get("refresh_token");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import axios from "axios";
|
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({
|
const axiosInstanceJson = axios.create({
|
||||||
baseURL,
|
baseURL,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export async function getCsrfToken() {
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
};
|
};
|
||||||
return httpGet(pathUrl, headers);
|
return httpGet(pathUrl, headers);
|
||||||
// const url = 'https://mediahub.polri.go.id/api/csrf';
|
// const url = 'https://mediahub.polri.go.id/api/v2/csrf';
|
||||||
// try {
|
// try {
|
||||||
// const response = await fetch(url, {
|
// const response = await fetch(url, {
|
||||||
// method: 'GET',
|
// method: 'GET',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue