Paar minor Fixes & Users brauchen nun auch Email
Some checks are pending
Deploy Volleyball Dev / deploy (push) Waiting to run

This commit is contained in:
Marc Wieland
2025-04-23 15:19:53 +02:00
parent 9eb917d086
commit 4d53aa4b50
6 changed files with 30 additions and 14 deletions

View File

@@ -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));

View File

@@ -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 }),