Paar minor Fixes & Users brauchen nun auch Email
Some checks are pending
Deploy Volleyball Dev / deploy (push) Waiting to run
Some checks are pending
Deploy Volleyball Dev / deploy (push) Waiting to run
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
|
||||
const apiBase = import.meta.env.VITE_API_URL;
|
||||
|
||||
type NewsItem = {
|
||||
id: number;
|
||||
title: string;
|
||||
@@ -14,7 +16,7 @@ const AlleNeuigkeitenPage = () => {
|
||||
const [news, setNews] = useState<NewsItem[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
fetch("http://192.168.50.65:3000/api/news")
|
||||
fetch(`${apiBase}/api/news`)
|
||||
.then((res) => res.json())
|
||||
.then((data) => setNews(data))
|
||||
.catch((err) => console.error("Fehler beim Laden der News:", err));
|
||||
|
||||
@@ -4,6 +4,8 @@ import { Input } from "@/components/ui/input";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
|
||||
const apiBase = import.meta.env.VITE_API_URL;
|
||||
|
||||
const LoginPage = () => {
|
||||
const [email, setEmail] = useState(""); // Wird eigentlich Username sein!
|
||||
const [password, setPassword] = useState("");
|
||||
@@ -15,7 +17,7 @@ const LoginPage = () => {
|
||||
setError("");
|
||||
|
||||
try {
|
||||
const res = await fetch("http://192.168.50.65:3000/api/login", {
|
||||
const res = await fetch(`${apiBase}/api/login`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ username: email, password }),
|
||||
|
||||
Reference in New Issue
Block a user