Fix requests base URL
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import type { ConfigResponse, ImportOptions, PrepareResponse, SubmitResponse, Transaction } from "../types/api";
|
import type { ConfigResponse, ImportOptions, PrepareResponse, SubmitResponse, Transaction } from "../types/api";
|
||||||
|
|
||||||
export async function fetchConfig(): Promise<ConfigResponse> {
|
export async function fetchConfig(): Promise<ConfigResponse> {
|
||||||
const response = await fetch("http://localhost:3000/config")
|
const response = await fetch("/config")
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
return data as ConfigResponse;
|
return data as ConfigResponse;
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@ export async function loadTransactions(csvFile: File, profile: string, server: s
|
|||||||
payload.append("profile", profile);
|
payload.append("profile", profile);
|
||||||
payload.append("server", server);
|
payload.append("server", server);
|
||||||
|
|
||||||
const response = await fetch("http://localhost:3000/prepare", {
|
const response = await fetch("/prepare", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: payload
|
body: payload
|
||||||
});
|
});
|
||||||
@@ -28,7 +28,7 @@ export async function submitTransactions(transactions: Transaction[], server: st
|
|||||||
opts
|
opts
|
||||||
};
|
};
|
||||||
|
|
||||||
const response = await fetch("http://localhost:3000/submit", {
|
const response = await fetch("/submit", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(payload),
|
body: JSON.stringify(payload),
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Reference in New Issue
Block a user