Hi,
Please I want to find out the best practice for updating an item on the server using the item_id alongside user_id.
This is what I want to do
bookRide(data)
{
this.rideservice.bookRide(this.bookData).then((result) => {
this.viewCtrl.dismiss();
this.navCtrl.pop();
}, (err) => {
this.loading.dismiss();
this.presentToast(err);
console.log(err);
});
}
This is my item.ts
this.http.post(`${Config.API_URL}/ride/book/id`, data, this.requestOptions).toPromise();
Here is the service provider and finally
<form (submit)="bookRide(bookride.id)">
<ion-card>
<ion-card-header>
Select Seat Number
</ion-card-header>
<ion-list >
<ion-item>
<ion-label stacked>Car Make</ion-label>
<ion-input [(ngModel)]="bookData.id" name="id" type="hidden" value="{{ bookride.id }}" placeholder="Your Name" ></ion-input>
</ion-item>
<ion-item>
<ion-label>Select ...</ion-label>
<ion-select [(ngModel)]="bookData.number_of_seats" name="number_of_seats">
<ion-option value="1">1</ion-option>
<ion-option value="2">2</ion-option>
<ion-option value="3">3</ion-option>
<ion-option value="4">4</ion-option>
</ion-select>
</ion-item>
</ion-list>
<button ion-button class="jr_offer_ride2" type="submit">
Book Ride
</button>
</ion-card>
</form>
The form am submitting