Fix
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
|
||||
using AutoMapper;
|
||||
|
||||
using skydiveLogs_api.Business.Interface;
|
||||
using skydiveLogs_api.DataContract;
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
@@ -24,6 +24,7 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
// GET: api/Aircraft
|
||||
[HttpGet]
|
||||
[EnableCors]
|
||||
public IEnumerable<AircraftResp> Get()
|
||||
{
|
||||
var result = _aircraftService.GetAllAircrafts();
|
||||
@@ -32,6 +33,7 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
// GET: api/Aircraft/5
|
||||
[HttpGet("{id}")]
|
||||
[EnableCors]
|
||||
public AircraftResp Get(int id)
|
||||
{
|
||||
var result = _aircraftService.GetAircraftById(id);
|
||||
@@ -40,6 +42,7 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
// POST: api/Aircraft
|
||||
[HttpPost]
|
||||
[EnableCors]
|
||||
public void Post([FromBody] AircraftReq value)
|
||||
{
|
||||
_aircraftService.AddNewAircraft(_mapper.Map<Aircraft>(value));
|
||||
@@ -47,6 +50,7 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
// PUT: api/Aircraft/5
|
||||
[HttpPut("{id}")]
|
||||
[EnableCors]
|
||||
public void Put(int id, [FromBody] AircraftReq value)
|
||||
{
|
||||
_aircraftService.UpdateAircraft(id, _mapper.Map<Aircraft>(value));
|
||||
@@ -54,6 +58,7 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
// DELETE: api/ApiWithActions/5
|
||||
[HttpDelete("{id}")]
|
||||
[EnableCors]
|
||||
public void Delete(int id)
|
||||
{
|
||||
_aircraftService.DeleteAircraftById(id);
|
||||
|
||||
Reference in New Issue
Block a user