Removing a tour list using Axios and Vuex
If you are still hungry to do some writing with Axios and Vuex, this is perfect for you. We will send a request to our ASP.NET Core Web API to retrieve the TourList
collection, render them on the UI using Vuetify components, and then be able to delete any of the TourList
objects. But before we start, let's update our ASP.NET Core Web API project.
Update the TourPackageDto.cs
file in namespace Travel.Application.Dtos.Tour
with the following code:
public float Price { get; set; } public string MapLocation { get; set; }
We are adding the Price
and MapLocation
properties.
Next, we update our backend service. Go to the TourPackagesController.cs
file, which has a namespace of Travel.WebApi.Controllers.v1
, and add a new async action method using the following code:
[HttpPut("{id}")] public async Task<ActionResult> Update(int id, UpdateTourPackageCommand command) { if (id != command.Id) &...