fix
This commit is contained in:
@@ -17,8 +17,12 @@ type BaseRequestParams = Partial<{
|
||||
method: "GET" | "POST";
|
||||
}>;
|
||||
|
||||
export const base = import.meta.env.DEV
|
||||
? "http://localhost:3040"
|
||||
: "https://haystack.johncosta.tech";
|
||||
|
||||
const getBaseRequest = ({ path, body, method }: BaseRequestParams): Request => {
|
||||
return new Request(`http://localhost:3040/${path}`, {
|
||||
return new Request(`${base}/${path}`, {
|
||||
body,
|
||||
method,
|
||||
});
|
||||
@@ -29,7 +33,7 @@ const getBaseAuthorizedRequest = ({
|
||||
body,
|
||||
method,
|
||||
}: BaseRequestParams): Request => {
|
||||
return new Request(`http://localhost:3040/${path}`, {
|
||||
return new Request(`${base}/${path}`, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${localStorage.getItem("access")?.toString()}`,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user