This commit is contained in:
2021-07-06 18:55:52 +00:00
parent 47a9b5153c
commit c01a90b588

View File

@@ -228,12 +228,13 @@ namespace AyaNova.Api.Controllers
}
}
}
var sorted = slist.OrderBy(z => z.customername).ThenBy(z => z.serial);
var sorted = slist.OrderBy(z => z.CustomerName).ThenBy(z => z.UnitSerial);
return Ok(ApiOkResponse.Response(sorted.Select(z => new NameIdItem { Id = z.unitid, Name = $"{z.serial} {z.customername}" }).ToList()));
//return Ok(ApiOkResponse.Response(sorted.Select(z => new NameIdItem { Id = z.unitid, Name = $"{z.serial} {z.customername}" }).ToList()));
return Ok(ApiOkResponse.Response(sorted));
}
public record UnitListByTagParams(List<string> tags, long? restrictToCustomerId);
private record InternalUnitListForSorting(string customername, string serial, long unitid);
private record InternalUnitListForSorting(string CustomerName, string UnitSerial, long UnitId);
//------------