This commit is contained in:
MarcEricMartel
2022-11-05 09:01:05 -07:00
parent 4608cb5de8
commit 0ffa974bd3
5 changed files with 53 additions and 28 deletions

View File

@@ -38,7 +38,7 @@ public class AddressController : Controller {
#endregion
#region API Methods
[EnableCors("_myAllowSpecificOrigins"), HttpGet(Name = "Addresses"), Route("ListAddresses")]
[EnableCors("_myAllowSpecificOrigins"), HttpGet]
public async Task<ActionResult<List<AddressModel>>> GetList(bool? all) {
IList<string> roles;
InventoryUser user;
@@ -69,7 +69,7 @@ public class AddressController : Controller {
}
}
[EnableCors("_myAllowSpecificOrigins"), HttpGet(Name = "Address")]
[EnableCors("_myAllowSpecificOrigins"), HttpGet("{id}")]
public async Task<ActionResult<AddressModel>> Get(int id) {
IList<string> roles;
string userId;
@@ -103,7 +103,7 @@ public class AddressController : Controller {
else return Unauthorized();
}
[EnableCors("_myAllowSpecificOrigins"), HttpPost(Name = "Address")]
[EnableCors("_myAllowSpecificOrigins"), HttpPost]
public async Task<ActionResult<AddressModel>> Post(AddressModel ad) {
try {
var user = await _userMan.GetUserAsync(_signInMan.Context.User);
@@ -117,7 +117,7 @@ public class AddressController : Controller {
return ad;
}
[EnableCors("_myAllowSpecificOrigins"), HttpPatch(Name = "Address")]
[EnableCors("_myAllowSpecificOrigins"), HttpPatch]
public async Task<ActionResult<AddressModel>> Patch(AddressModel ad) {
IList<string> roles;
InventoryUser user;
@@ -149,7 +149,7 @@ public class AddressController : Controller {
return ad;
}
[EnableCors("_myAllowSpecificOrigins"), HttpDelete(Name = "Address")]
[EnableCors("_myAllowSpecificOrigins"), HttpDelete]
public async Task<ActionResult<int>> Delete(int id) {
IList<string> roles;
AddressModel ad;