added prize draw name to tables

This commit is contained in:
2026-06-03 16:29:45 +02:00
parent f7a0a3753c
commit a66b150d97
11 changed files with 91 additions and 29 deletions
+8 -1
View File
@@ -1,5 +1,6 @@
import { API_BASE } from "../../config/api.config";
import type { FormData } from "../../config/interfaces.config";
import Cookies from "js-cookie";
export const submitFormData = async (
data: FormData,
@@ -7,10 +8,16 @@ export const submitFormData = async (
) => {
console.warn("submitFormData is fetching!");
const draw = Cookies.get("selectedDraw");
if (!draw) {
throw new Error("You need to set an prize draw!");
}
// await new Promise((resolve) => setTimeout(resolve, 3000)); // Wait 3 seconds
const response = await fetch(
`${API_BASE}/default/new-entry?username=${username}`,
`${API_BASE}/default/new-entry?username=${username}&draw=${draw}`,
{
method: "POST",
headers: {
+3 -3
View File
@@ -1,10 +1,10 @@
import { API_BASE } from "../../config/api.config";
import Cookies from "js-cookie";
export const fetchUsers = async () => {
console.warn("fetchUsers is fetching!");
export const fetchInfo = async () => {
console.warn("fetchInfo is fetching!");
const response = await fetch(`${API_BASE}/default/users`);
const response = await fetch(`${API_BASE}/default/info`);
const data = await response.json();
return data;