diff --git a/backend/routes/offer.js b/backend/routes/offer.js index 30d72067..79e508ec 100644 --- a/backend/routes/offer.js +++ b/backend/routes/offer.js @@ -50,7 +50,7 @@ async function addOffer(description, startLocation, endLocation, startDate, endD const addOfferAd = ` INSERT INTO ad (description, startLocation, endLocation, startDate, endDate, animals, smoker, notes, numSeats, userId) VALUES (?,?,?,?,?,?,?,?,?,?)`; - const addOffer = 'INSERT INTO offer (vehicleId, adId, pricePerPerson, pricePerFreight) VALUES (?, ?, ?, ?)'; + const addOffer = 'INSERT INTO offer (vehicleId, adId, pricePerPerson, pricePerFreight) VALUES (?, last_insert_id(), ?, ?)'; try { const conn = await pool.getConnection(); diff --git a/frontend/mycargonaut/src/app/main/ad/ad.component.html b/frontend/mycargonaut/src/app/main/ad/ad.component.html index f321264d..46bee557 100644 --- a/frontend/mycargonaut/src/app/main/ad/ad.component.html +++ b/frontend/mycargonaut/src/app/main/ad/ad.component.html @@ -24,17 +24,6 @@
-
-
- Price per Person: {{typeSpecificContent.pricePerPerson}}
- Price per Freight: {{typeSpecificContent.pricePerFreight}} -
-
- Preis: {{typeSpecificContent.price}}
- Fracht: {{typeSpecificContent.freight}}
- Sitze: {{typeSpecificContent.numSeats}} -
-
@@ -126,7 +115,7 @@
{{writeTitle(ad)}}
- + {{typeSpecificContent.price}}
toll @@ -172,12 +161,12 @@
{{writeTitle(ad)}}
Menge an Fracht in Kg - Gesamtpreis: + Gesamtpreis: {{this.typeSpecificContent.pricePerFreight * bookingForm.value.freight+ this.typeSpecificContent.pricePerPerson * bookingForm.value.numSeats}}