mirror of
https://github.com/0xShay/ticketchain.git
synced 2026-01-11 21:23:24 +00:00
finished up event forms & starting ticket history
This commit is contained in:
40
app/page.tsx
40
app/page.tsx
@@ -6,47 +6,15 @@ import EventForm from '@/components/custom/EventForm';
|
|||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
// Define the handleSubmit function
|
// Define the handleSubmit function
|
||||||
const handleSubmit = (data: {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
capacity: number;
|
|
||||||
ticketPrice: number;
|
|
||||||
eventStartTime: Date; // event day
|
|
||||||
eventEndTime?: Date;
|
|
||||||
images?: string[];
|
|
||||||
}) => {
|
|
||||||
try {
|
|
||||||
// Log the data to the console (you can replace this with an API call or other logic)
|
|
||||||
console.log('Form Submitted:', data);
|
|
||||||
|
|
||||||
// You can format the eventDate if needed (e.g., to a specific date format)
|
|
||||||
const formattedDate = new Date(data.eventStartTime).toISOString();
|
|
||||||
console.log('Formatted Event Date:', formattedDate);
|
|
||||||
|
|
||||||
// Example: Post data to an API endpoint
|
|
||||||
// fetch('/api/events', {
|
|
||||||
// method: 'POST',
|
|
||||||
// headers: {
|
|
||||||
// 'Content-Type': 'application/json',
|
|
||||||
// },
|
|
||||||
// body: JSON.stringify({ ...data, eventDate: formattedDate }),
|
|
||||||
// })
|
|
||||||
// .then((response) => response.json())
|
|
||||||
// .then((result) => {
|
|
||||||
// console.log('Success:', result);
|
|
||||||
// })
|
|
||||||
// .catch((error) => {
|
|
||||||
// console.error('Error:', error);
|
|
||||||
// });
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error submitting form:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <Home /> */}
|
{/* <Home /> */}
|
||||||
<EventForm onSubmit={(data) => handleSubmit(data)} />
|
{/* <EventForm onSubmit={(data) => handleSubmit(data)} /> */}
|
||||||
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
interface previousTicket{
|
||||||
|
|
||||||
|
name: string,
|
||||||
|
status: boolean,
|
||||||
|
|
||||||
|
// ticket status
|
||||||
|
//
|
||||||
|
// optional transfer
|
||||||
|
}
|
||||||
|
|
||||||
|
const previousTicket = () => {
|
||||||
|
return (
|
||||||
|
<div>previousTicket</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default previousTicket;
|
||||||
|
|||||||
Reference in New Issue
Block a user