performance and scalability improvement - get the most recent HtmlText record directly from database and cache only a single object rather than the entire collection

This commit is contained in:
sbwalker
2026-02-17 16:25:10 -05:00
parent 912ed66547
commit df7f3f7bba
7 changed files with 50 additions and 119 deletions

View File

@@ -58,23 +58,6 @@ namespace Oqtane.Modules.HtmlText.Controllers
}
}
// GET api/<controller>/5/6
[HttpGet("{id}/{moduleId}")]
[Authorize(Policy = PolicyNames.ViewModule)]
public async Task<Models.HtmlText> Get(int id, int moduleId)
{
if (IsAuthorizedEntityId(EntityNames.Module, moduleId))
{
return await _htmlTextService.GetHtmlTextAsync(id, moduleId);
}
else
{
_logger.Log(LogLevel.Error, this, LogFunction.Security, "Unauthorized Html/Text Get Attempt {HtmlTextId}", id);
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
return null;
}
}
// POST api/<controller>
[HttpPost]
[Authorize(Policy = PolicyNames.EditModule)]