diff --git a/app/ayanova/src/components/inventorywidgetlist.vue b/app/ayanova/src/components/inventorywidgetlist.vue index 14897e44..c7a1b95d 100644 --- a/app/ayanova/src/components/inventorywidgetlist.vue +++ b/app/ayanova/src/components/inventorywidgetlist.vue @@ -133,17 +133,20 @@ export default { getDataFromApi() { // debugger; var listOptions = { - Offset: 0, - Limit: 5, - SortBy: "name" + offset: 0, + limit: 5, + sort: "name", + asc:true }; if (this.pagination.rowsPerPage && this.pagination.rowsPerPage > 0) { - listOptions.Offset = + listOptions.offset = (this.pagination.page - 1) * this.pagination.rowsPerPage; - listOptions.Limit = this.pagination.rowsPerPage; + listOptions.limit = this.pagination.rowsPerPage; } - listOptions.SortBy = this.pagination.sortBy; + listOptions.sort = this.pagination.sortBy; + listOptions.asc=!this.pagination.descending; + this.loading = true; pagedList.fetch("Widget/ListWidgets", listOptions).then(res => { // debugger; diff --git a/server/AyaNova/ControllerHelpers/PagingOptions.cs b/server/AyaNova/ControllerHelpers/PagingOptions.cs index 9470df81..d9517aa7 100644 --- a/server/AyaNova/ControllerHelpers/PagingOptions.cs +++ b/server/AyaNova/ControllerHelpers/PagingOptions.cs @@ -18,6 +18,10 @@ namespace AyaNova.Api.ControllerHelpers [Range(1, MaxPageSize, ErrorMessage = "Limit must be greater than 0 and less than 100.")] public int? Limit { get; set; } + public string Sort {get;set;} + public bool? Asc {get;set;} + + } } \ No newline at end of file