This commit is contained in:
@@ -89,9 +89,8 @@ namespace AyaNova.Api.Controllers
|
|||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
return BadRequest(new ApiErrorResponse(ModelState));
|
return BadRequest(new ApiErrorResponse(ModelState));
|
||||||
if (id == 0)
|
if (id == 0)
|
||||||
{
|
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_INVALID_VALUE, "id", "id can't be zero"));
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
var res = await Search.GetInfoAsync(UserTranslationIdFromContext.Id(HttpContext.Items),
|
var res = await Search.GetInfoAsync(UserTranslationIdFromContext.Id(HttpContext.Items),
|
||||||
UserRolesFromContext.Roles(HttpContext.Items), UserIdFromContext.Id(HttpContext.Items), phrase, max, ayaType, id, ct);
|
UserRolesFromContext.Roles(HttpContext.Items), UserIdFromContext.Id(HttpContext.Items), phrase, max, ayaType, id, ct);
|
||||||
@@ -121,7 +120,8 @@ namespace AyaNova.Api.Controllers
|
|||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
return BadRequest(new ApiErrorResponse(ModelState));
|
return BadRequest(new ApiErrorResponse(ModelState));
|
||||||
if (id == 0)
|
if (id == 0)
|
||||||
return NotFound();
|
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_INVALID_VALUE, "id", "id can't be zero"));
|
||||||
|
|
||||||
switch (ayaType)
|
switch (ayaType)
|
||||||
{
|
{
|
||||||
case AyaType.WorkOrderItem:
|
case AyaType.WorkOrderItem:
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ namespace AyaNova
|
|||||||
// {
|
// {
|
||||||
// OnPrepareResponse = context =>
|
// OnPrepareResponse = context =>
|
||||||
// {
|
// {
|
||||||
// if (context.File.Name == "index.html")
|
// if (context.File.Name == "kindex.html")
|
||||||
// {
|
// {
|
||||||
// context.Context.Response.Headers.Add("Cache-Control", "no-cache, no-store");
|
// context.Context.Response.Headers.Add("Cache-Control", "no-cache, no-store");
|
||||||
// context.Context.Response.Headers.Add("Expires", "-1");
|
// context.Context.Response.Headers.Add("Expires", "-1");
|
||||||
@@ -585,7 +585,7 @@ namespace AyaNova
|
|||||||
//to support html5 pushstate routing in spa
|
//to support html5 pushstate routing in spa
|
||||||
//this ensures that a refresh at the client will not 404 but rather force back to the index.html app page and then handled internally by the client
|
//this ensures that a refresh at the client will not 404 but rather force back to the index.html app page and then handled internally by the client
|
||||||
await next();
|
await next();
|
||||||
if (!context.Response.HasStarted && context.Request.Path.Value != "/docs" && context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value))
|
if (!context.Response.HasStarted && !context.Request.Path.Value.StartsWith("/api") && context.Request.Path.Value != "/docs" && context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value))
|
||||||
{
|
{
|
||||||
context.Request.Path = "/index.html";
|
context.Request.Path = "/index.html";
|
||||||
context.Response.StatusCode = 200;
|
context.Response.StatusCode = 200;
|
||||||
|
|||||||
Reference in New Issue
Block a user