fix #242 - module definitions not loading in Edit page
This commit is contained in:
@ -33,10 +33,10 @@ namespace Oqtane.Controllers
|
||||
|
||||
// GET: api/<controller>?siteid=x
|
||||
[HttpGet]
|
||||
public IEnumerable<ModuleDefinition> Get(int siteid)
|
||||
public IEnumerable<ModuleDefinition> Get(string siteid)
|
||||
{
|
||||
List<ModuleDefinition> moduledefinitions = new List<ModuleDefinition>();
|
||||
foreach(ModuleDefinition moduledefinition in ModuleDefinitions.GetModuleDefinitions(siteid))
|
||||
foreach(ModuleDefinition moduledefinition in ModuleDefinitions.GetModuleDefinitions(int.Parse(siteid)))
|
||||
{
|
||||
if (UserPermissions.IsAuthorized(User, "Utilize", moduledefinition.Permissions))
|
||||
{
|
||||
@ -63,16 +63,6 @@ namespace Oqtane.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// GET api/<controller>/filename
|
||||
[HttpGet("{filename}")]
|
||||
public IActionResult Get(string assemblyname)
|
||||
{
|
||||
string binfolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
byte[] file = System.IO.File.ReadAllBytes(Path.Combine(binfolder, assemblyname));
|
||||
return File(file, "application/octet-stream", assemblyname);
|
||||
}
|
||||
|
||||
// PUT api/<controller>/5
|
||||
[HttpPut("{id}")]
|
||||
[Authorize(Roles = Constants.AdminRole)]
|
||||
@ -123,5 +113,14 @@ namespace Oqtane.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
// GET api/<controller>/load/filename
|
||||
[HttpGet("load/{filename}")]
|
||||
public IActionResult Load(string assemblyname)
|
||||
{
|
||||
string binfolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
byte[] file = System.IO.File.ReadAllBytes(Path.Combine(binfolder, assemblyname));
|
||||
return File(file, "application/octet-stream", assemblyname);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user