Some tweaks
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
import { API_URL } from "@/lib/constants";
|
||||
import { ApiResponse } from "@/types/types";
|
||||
import { getApiUrl } from "@/utils/api";
|
||||
import { getCookie } from "cookies-next";
|
||||
import { useState, useRef, useCallback } from "react";
|
||||
|
||||
@@ -24,7 +25,7 @@ const useFileUpload = (): UseFileUploadReturn => {
|
||||
|
||||
const uploadFile = useCallback(
|
||||
(file: File, url: string, onSuccess?: (response: any) => void) => {
|
||||
url = `${API_URL}${url}`;
|
||||
url = `${getApiUrl()}${url}`;
|
||||
if (!file || !url) {
|
||||
setError("File and upload URL are required.");
|
||||
return;
|
||||
@@ -35,7 +36,7 @@ const useFileUpload = (): UseFileUploadReturn => {
|
||||
return;
|
||||
}
|
||||
|
||||
fetch(`${API_URL}/media/verify`, {
|
||||
fetch(`${getApiUrl()}/media/verify`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
name: file.name,
|
||||
|
||||
Reference in New Issue
Block a user