Add a property "IsFavorite" for the drop zone.

This commit is contained in:
Sébastien André
2019-11-27 14:06:22 +01:00
parent 41eecd2a68
commit bee8ca06f4
13 changed files with 60 additions and 17 deletions

View File

@@ -50,9 +50,9 @@ namespace skydiveLogs_api.Controllers
// PUT: api/DropZone/5
[HttpPut("{id}")]
public void Put(int id, [FromBody] DropZoneReq value)
public bool Put(int id, [FromBody] DropZoneReq value)
{
_dropZoneService.UpdateDz(id, _mapper.Map<DropZone>(value));
return _dropZoneService.UpdateDz(id, _mapper.Map<DropZone>(value));
}
// DELETE: api/ApiWithActions/5

View File

@@ -1,10 +1,13 @@
using System.Collections.Generic;
using AutoMapper;
using Microsoft.AspNetCore.Mvc;
using AutoMapper;
using skydiveLogs_api.Business.Interface;
using skydiveLogs_api.DataContract;
using skydiveLogs_api.Model;
namespace skydiveLogs_api.Controllers
{
[Route("api/[controller]")]

View File

@@ -1,11 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace skydiveLogs_api.DataContract
{
public class DropZoneReq
{
public int Id { get; set; }
public string Latitude { get; set; }
public string Longitude { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public string Website { get; set; }
public string Email { get; set; }
public IEnumerable<string> Type { get; set; }
public bool IsFavorite { get; set; }
}
}

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace skydiveLogs_api.DataContract
{
@@ -22,5 +19,7 @@ namespace skydiveLogs_api.DataContract
public string Email { get; set; }
public IEnumerable<string> Type { get; set; }
public bool IsFavorite { get; set; }
}
}