feat: enhance user confirmation and data submission; add newEntry function and update MainForm to handle user selection

This commit is contained in:
2026-01-20 18:50:16 +01:00
parent 001999f21d
commit fd37e40253
5 changed files with 57 additions and 34 deletions

View File

@@ -14,9 +14,9 @@ interface FormData {
paymentMethod: string;
}
export const submitFormData = async (data: FormData) => {
export const submitFormData = async (data: FormData, username: string) => {
try {
const response = await fetch("/backend/default/frontend", {
const response = await fetch(`http://localhost:8004/default/new-entry?username=${username}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -27,7 +27,7 @@ export const submitFormData = async (data: FormData) => {
if (!response.ok) {
const errorText = await response.text();
return { success: false, error: `Server error: ${errorText}` };
}
}
return { success: true };
} catch (error) {