Implementation to have a favorite DZ by user.
This commit is contained in:
@@ -25,7 +25,7 @@ namespace skydiveLogs_api.Controllers
|
||||
[EnableCors]
|
||||
public IEnumerable<DropZoneResp> Get()
|
||||
{
|
||||
var result = _dropZoneService.GetAllDzs();
|
||||
var result = _dropZoneService.GetAllDzs(ConnectedUser);
|
||||
|
||||
return _mapper.Map<IEnumerable<DropZoneResp>>(result);
|
||||
}
|
||||
@@ -56,7 +56,7 @@ namespace skydiveLogs_api.Controllers
|
||||
return _dropZoneService.UpdateDz(id, _mapper.Map<DropZone>(value));
|
||||
}
|
||||
|
||||
// DELETE: api/ApiWithActions/5
|
||||
// DELETE: api/ApiWithActions
|
||||
[HttpDelete("{id}")]
|
||||
[EnableCors]
|
||||
public void Delete(int id)
|
||||
@@ -64,6 +64,22 @@ namespace skydiveLogs_api.Controllers
|
||||
_dropZoneService.DeleteDzById(id);
|
||||
}
|
||||
|
||||
// PUT: api/DropZone/AddToFavorite/5
|
||||
[HttpPut("{id}")]
|
||||
[EnableCors]
|
||||
public bool AddToFavorite(int id)
|
||||
{
|
||||
return _dropZoneService.AddToFavorite(id, ConnectedUser);
|
||||
}
|
||||
|
||||
// PUT: api/DropZone/RemoveToFavorite/15
|
||||
[HttpPut("{id}")]
|
||||
[EnableCors]
|
||||
public bool RemoveToFavorite(int id)
|
||||
{
|
||||
return _dropZoneService.RemoveToFavorite(id, ConnectedUser);
|
||||
}
|
||||
|
||||
private readonly IDropZoneService _dropZoneService;
|
||||
private readonly IMapper _mapper;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user