Skip to content

Commit

Permalink
With check if default selection should be applied
Browse files Browse the repository at this point in the history
  • Loading branch information
likp committed Nov 11, 2024
1 parent ef69304 commit e93162c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion PxWeb/Controllers/Api2/TableApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,28 @@ public TableApiController(IDataSource dataSource, ILanguageHelper languageHelper
_placementHandler = placementHandler;
}

public override IActionResult GetMetadataById([FromRoute(Name = "id"), Required] string id, [FromQuery(Name = "lang")] string? lang, [FromQuery(Name = "outputFormat")] MetadataOutputFormatType? outputFormat)
public override IActionResult GetMetadataById([FromRoute(Name = "id"), Required] string id, [FromQuery(Name = "lang")] string? lang, [FromQuery(Name = "outputFormat")] MetadataOutputFormatType? outputFormat, [FromQuery(Name = "defaultSelection")] bool? defaultSelection)
{
lang = _languageHelper.HandleLanguage(lang);
IPXModelBuilder? builder = _dataSource.CreateBuilder(id, lang);



if (builder != null)
{
try
{
builder.BuildForSelection();
var model = builder.Model;

if (defaultSelection is not null && defaultSelection == true)
{
//apply the default selection
Problem? problem;
var selectionx = _selectionHandler.GetDefaultSelection(builder, out problem);
}


if (outputFormat != null && outputFormat == MetadataOutputFormatType.Stat2Enum)
{

Expand Down

0 comments on commit e93162c

Please sign in to comment.