Enhance backend and frontend setup with MySQL integration, Docker configurations, and toast notifications
- Updated .gitignore to include additional environment and build files - Configured Dockerfiles for backend and frontend with npm install and port exposure - Added MySQL connection pool and query function in backend services - Implemented form submission with toast notifications in MainForm component - Updated package.json and package-lock.json for new dependencies - Enhanced routing and layout in frontend with toast notifications
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import React from "react";
|
||||
import { registerLos } from "../utils/register";
|
||||
import { toast } from "react-toastify";
|
||||
|
||||
const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => {
|
||||
event.preventDefault();
|
||||
const formData = new FormData(event.currentTarget);
|
||||
const data = Object.fromEntries(formData.entries());
|
||||
await registerLos(data);
|
||||
toast.promise(registerLos(data), {
|
||||
pending: "Registriere Los...",
|
||||
success: "Los erfolgreich registriert!",
|
||||
error: "Fehler bei der Registrierung des Loses.",
|
||||
});
|
||||
};
|
||||
|
||||
const MainForm: React.FC = () => {
|
||||
@@ -72,15 +77,15 @@ const MainForm: React.FC = () => {
|
||||
|
||||
<div className="space-y-1">
|
||||
<label
|
||||
htmlFor="strasse"
|
||||
htmlFor="adresse"
|
||||
className="text-sm font-medium text-zinc-800"
|
||||
>
|
||||
Straße + Haus Nr.:
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="strasse"
|
||||
name="strasse"
|
||||
id="adresse"
|
||||
name="adresse"
|
||||
placeholder="Musterstraße 1"
|
||||
required
|
||||
className="w-full rounded-xl border border-black/25 bg-white/80 px-4 py-2.5 text-sm text-zinc-800 placeholder-zinc-400 shadow-inner outline-none focus:border-black/40 focus:ring-2 focus:ring-black/10"
|
||||
|
Reference in New Issue
Block a user