Fix requests base URL

This commit is contained in:
2025-05-09 19:37:28 +02:00
parent 3a5ff132ed
commit f9cfdbd4a0

View File

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