18 lines
461 B
TypeScript
18 lines
461 B
TypeScript
import { myToast } from "./toastify";
|
|
|
|
export const registerLos = async (data: any) => {
|
|
await fetch("https://backend.lose.the1s.de/lose", {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
body: JSON.stringify(data),
|
|
}).then((response) => {
|
|
if (response.ok) {
|
|
myToast("Los erfolgreich registriert!", "success");
|
|
} else {
|
|
myToast("Fehler bei der Registrierung des Loses!", "error");
|
|
}
|
|
});
|
|
};
|