refactor: rename product to partyEvent in list page and view component
This commit is contained in:
@@ -6,20 +6,15 @@ Content-Type: application/json
|
||||
{
|
||||
"partyEventData": {
|
||||
"id":"e99f09a7-dd88-49d5-b1c8-1daf80c2d7b01",
|
||||
"title": "Summer Music Festival",
|
||||
"title": "Summer Music Festival 111",
|
||||
"name": "Summer Music Festival 111",
|
||||
"description": "Annual summer music festival featuring local bands and artists",
|
||||
"startDate": "2024-07-15T18:00:00Z",
|
||||
"endDate": "2024-07-15T23:00:00Z",
|
||||
"location": "Central Park, Hong Kong",
|
||||
"coverUrl": "",
|
||||
"images": [
|
||||
"data:image/png;base64,C",
|
||||
"data:image/png;base64,C"
|
||||
],
|
||||
"tags": [
|
||||
"Music",
|
||||
"Festival"
|
||||
],
|
||||
"images": [ "data:image/png;base64,C", "data:image/png;base64,C" ],
|
||||
"tags": [ "Music", "Festival" ],
|
||||
"status": "upcoming",
|
||||
"capacity": 500,
|
||||
"price": 150.00,
|
||||
@@ -30,6 +25,7 @@ Content-Type: application/json
|
||||
"requirements": "Age 18+",
|
||||
"schedule": "18:00 Doors open\n19:00 First performance\n21:00 Main act",
|
||||
"speakers": ["DJ Lee", "Band XYZ"],
|
||||
"sponsors": ["HK Radio", "Music Magazine"]
|
||||
"sponsors": ["HK Radio", "Music Magazine"],
|
||||
"reviews":[]
|
||||
}
|
||||
}
|
||||
|
@@ -76,10 +76,57 @@ async function createEvent(eventData: any) {
|
||||
return await prisma.eventItem.create({ data: eventData });
|
||||
}
|
||||
|
||||
async function updateEvent(eventId: string, updateForm: UpdateEvent) {
|
||||
async function updateEvent(eventId: string, updateForm: any) {
|
||||
return prisma.eventItem.update({
|
||||
where: { id: eventId },
|
||||
data: updateForm,
|
||||
data: {
|
||||
available: updateForm.available,
|
||||
category: updateForm.category,
|
||||
code: updateForm.code,
|
||||
colors: updateForm.colors,
|
||||
coverUrl: updateForm.coverUrl,
|
||||
description: updateForm.description,
|
||||
gender: updateForm.gender,
|
||||
images: updateForm.images,
|
||||
inventoryType: updateForm.inventoryType,
|
||||
name: updateForm.name,
|
||||
newLabel: updateForm.newLabel,
|
||||
price: updateForm.price,
|
||||
priceSale: updateForm.priceSale,
|
||||
publish: updateForm.publish,
|
||||
quantity: updateForm.quantity,
|
||||
ratings: updateForm.ratings,
|
||||
saleLabel: updateForm.saleLabel,
|
||||
sizes: updateForm.sizes,
|
||||
sku: updateForm.sku,
|
||||
subDescription: updateForm.subDescription,
|
||||
tags: updateForm.tags,
|
||||
taxes: updateForm.taxes,
|
||||
totalRatings: updateForm.totalRatings,
|
||||
totalReviews: updateForm.totalReviews,
|
||||
totalSold: updateForm.totalSold,
|
||||
//
|
||||
ageBottom: updateForm.ageBottom,
|
||||
ageTop: updateForm.ageTop,
|
||||
avatar: updateForm.avatar,
|
||||
currency: updateForm.currency,
|
||||
capacity: updateForm.capacity,
|
||||
duration_m: updateForm.duration_m,
|
||||
endDate: updateForm.endDate,
|
||||
eventDate: updateForm.eventDate,
|
||||
isFeatured: updateForm.isFeatured,
|
||||
joinMembers: updateForm.joinMembers,
|
||||
location: updateForm.location,
|
||||
organizer: updateForm.organizer,
|
||||
registrationDeadline: updateForm.registrationDeadline,
|
||||
requirements: updateForm.requirements,
|
||||
schedule: updateForm.schedule,
|
||||
speakers: updateForm.speakers,
|
||||
sponsors: updateForm.sponsors,
|
||||
startDate: updateForm.startDate,
|
||||
status: updateForm.status,
|
||||
title: updateForm.title,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user