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_TINYMCE_API_KEY=bhteuja26yz5p0aubxry9b95hs33amgn65kjv5km0fd5iuev
|
||||
|
|
@ -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",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in New Issue