Fix
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
|
||||
using AutoMapper;
|
||||
|
||||
@@ -23,6 +24,7 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
// GET: api/Gear
|
||||
[HttpGet]
|
||||
[EnableCors]
|
||||
public IEnumerable<GearResp> Get()
|
||||
{
|
||||
var result = _gearService.GetAllGears();
|
||||
@@ -31,6 +33,7 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
// GET: api/Gear/5
|
||||
[HttpGet("{id}")]
|
||||
[EnableCors]
|
||||
public GearResp Get(int id)
|
||||
{
|
||||
var result = _gearService.GetGearById(id);
|
||||
@@ -39,6 +42,7 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
// POST: api/Gear
|
||||
[HttpPost]
|
||||
[EnableCors]
|
||||
public void Post([FromBody] GearReq value)
|
||||
{
|
||||
_gearService.AddNewGear(_mapper.Map<Gear>(value));
|
||||
@@ -46,6 +50,7 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
// PUT: api/Gear/5
|
||||
[HttpPut("{id}")]
|
||||
[EnableCors]
|
||||
public void Put(int id, [FromBody] GearReq value)
|
||||
{
|
||||
_gearService.UpdateGear(id, _mapper.Map<Gear>(value));
|
||||
@@ -53,6 +58,7 @@ namespace skydiveLogs_api.Controllers
|
||||
|
||||
// DELETE: api/ApiWithActions/5
|
||||
[HttpDelete("{id}")]
|
||||
[EnableCors]
|
||||
public void Delete(int id)
|
||||
{
|
||||
_gearService.DeleteGearById(id);
|
||||
|
||||
Reference in New Issue
Block a user