This commit is contained in:
2021-03-01 23:10:06 +00:00
parent ad10e15eea
commit 2a1713aadc
4 changed files with 47 additions and 41 deletions

View File

@@ -70,20 +70,24 @@ namespace AyaNova.Api.Controllers
if (format != "csv" && format != "json")
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_INVALID_VALUE, null, "format not valid, must be 'csv' or 'json'"));
var UserId = UserIdFromContext.Id(HttpContext.Items);
var UserRoles = UserRolesFromContext.Roles(HttpContext.Items);
var UserTranslationId = UserTranslationIdFromContext.Id(HttpContext.Items);
//Rehydrate id list if necessary
if (selectedRequest.SelectedRowIds.Length == 0)
selectedRequest.SelectedRowIds = await DataListSelectedProcessingOptions.RehydrateIdList(
selectedRequest,
ct,
UserRolesFromContext.Roles(HttpContext.Items),
UserRoles,
log,
UserIdFromContext.Id(HttpContext.Items),
UserTranslationIdFromContext.Id(HttpContext.Items));
UserId,
UserTranslationId);
log.LogDebug($"Instantiating biz object handler for {selectedRequest.ObjectType}");
var biz = BizObjectFactory.GetBizObject(selectedRequest.ObjectType, ct);
var biz = BizObjectFactory.GetBizObject(selectedRequest.ObjectType, ct, UserId, UserRoles, UserTranslationId);
log.LogDebug($"Fetching data for {selectedRequest.SelectedRowIds.Length} {selectedRequest.ObjectType} items");
// var TheData = await ((IExportAbleObject)biz).GetJSONExportData(dataListSelection.SelectedRowIds);