admin page fetcher is now receiving a onLastPageComplete function that is used to show "no results" messages only after the last page is fetched

This commit is contained in:
luisramos0
2018-06-28 23:17:42 +01:00
committed by Maikel Linke
parent d5d1eae715
commit dfb510debe
4 changed files with 15 additions and 6 deletions

View File

@@ -8,7 +8,8 @@ angular.module("ofn.admin").factory "BulkProducts", (PagedFetcher, dataFetcher,
, ""
url = "/api/products/bulk_products?page=::page::;per_page=20;#{queryString}"
PagedFetcher.fetch url, (data) => @addProducts data.products
processData = (data) => @addProducts data.products
PagedFetcher.fetch url, processData, onComplete
cloneProduct: (product) ->
$http.post("/api/products/" + product.id + "/clone").success (data) =>