added prize draw name to tables
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user