Server naming fixes and cleanup
Server is now completely cleaned up and without warnings
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Oqtane.Repository;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Shared;
|
||||
using Oqtane.Infrastructure;
|
||||
using Oqtane.Infrastructure.Interfaces;
|
||||
using Oqtane.Repository;
|
||||
|
||||
namespace Oqtane.Controllers
|
||||
{
|
||||
@ -39,27 +39,27 @@ namespace Oqtane.Controllers
|
||||
// POST api/<controller>
|
||||
[HttpPost]
|
||||
[Authorize(Roles = Constants.AdminRole)]
|
||||
public Role Post([FromBody] Role Role)
|
||||
public Role Post([FromBody] Role role)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
Role = _roles.AddRole(Role);
|
||||
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Role Added {Role}", Role);
|
||||
role = _roles.AddRole(role);
|
||||
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Role Added {Role}", role);
|
||||
}
|
||||
return Role;
|
||||
return role;
|
||||
}
|
||||
|
||||
// PUT api/<controller>/5
|
||||
[HttpPut("{id}")]
|
||||
[Authorize(Roles = Constants.AdminRole)]
|
||||
public Role Put(int id, [FromBody] Role Role)
|
||||
public Role Put(int id, [FromBody] Role role)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
Role = _roles.UpdateRole(Role);
|
||||
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Role Updated {Role}", Role);
|
||||
role = _roles.UpdateRole(role);
|
||||
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Role Updated {Role}", role);
|
||||
}
|
||||
return Role;
|
||||
return role;
|
||||
}
|
||||
|
||||
// DELETE api/<controller>/5
|
||||
|
Reference in New Issue
Block a user