This commit is contained in:
@@ -61,8 +61,9 @@ namespace AyaNova.Api.Controllers
|
|||||||
if (dataListSelection.IsEmpty)
|
if (dataListSelection.IsEmpty)
|
||||||
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, null, "DataListSelection is required"));
|
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, null, "DataListSelection is required"));
|
||||||
|
|
||||||
if (!dataListSelection.ObjectType.HasAttribute(typeof(CoreBizObjectAttribute)))
|
//Not sure exactly what this is, maybe copied from a bulk tag op fragment?
|
||||||
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, null, "Not a taggable object type"));
|
// if (!dataListSelection.ObjectType.HasAttribute(typeof(CoreBizObjectAttribute)))
|
||||||
|
// return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, null, "Not a taggable object type"));
|
||||||
|
|
||||||
if (!Authorized.HasReadFullRole(HttpContext.Items, dataListSelection.ObjectType))
|
if (!Authorized.HasReadFullRole(HttpContext.Items, dataListSelection.ObjectType))
|
||||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||||
@@ -93,12 +94,12 @@ namespace AyaNova.Api.Controllers
|
|||||||
log.LogDebug($"Calling render export data to file {outputZipFullpath}");
|
log.LogDebug($"Calling render export data to file {outputZipFullpath}");
|
||||||
switch (format)
|
switch (format)
|
||||||
{
|
{
|
||||||
case "csv":
|
case "csv":
|
||||||
using (var w = new ChoCSVWriter(outputSourceFullPath).WithFirstLineHeader())
|
using (var w = new ChoCSVWriter(outputSourceFullPath).WithFirstLineHeader())
|
||||||
{
|
{
|
||||||
var dat = await ((IExportAbleObject)biz).GetExportData(dataListSelection.SelectedRowIds);
|
var dat = await ((IExportAbleObject)biz).GetExportData(dataListSelection.SelectedRowIds);
|
||||||
w.Write(ToDynamicList(dat));
|
w.Write(ToDynamicList(dat));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "json":
|
case "json":
|
||||||
using (StreamWriter file = System.IO.File.CreateText(outputSourceFullPath))
|
using (StreamWriter file = System.IO.File.CreateText(outputSourceFullPath))
|
||||||
|
|||||||
Reference in New Issue
Block a user