Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/assets/javascripts/sprangular/services/catalog.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Sprangular.service 'Catalog', ($http, $q, _, Status, Env) ->
options.search = search
@getPaged(page, options)

productsByTaxon: (path, page=1) ->
productsByTaxon: (path, page=1, options) ->
options ||= {}
@getPaged(page, taxon: path)

taxonomies: ->
Expand Down Expand Up @@ -37,8 +38,8 @@ Sprangular.service 'Catalog', ($http, $q, _, Status, Env) ->
Status.cacheProduct(response)
response

getPaged: (page=1, params={}) ->
$http.get("/api/products", ignoreLoadingIndicator: params.ignoreLoadingIndicator, params: {per_page: @pageSize, page: page, "q[name_or_description_cont]": params.search, "q[taxons_permalink_eq]": params.taxon})
getPaged: (page=1, params={}, options) ->
$http.get("/api/products", ignoreLoadingIndicator: options.ignoreLoadingIndicator, params: {per_page: @pageSize, page: page, "q[name_or_description_cont]": params.search, "q[taxons_permalink_eq]": params.taxon})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line exceeds maximum allowed length

.then (response) ->
data = response.data
list = Sprangular.extend(data.products || [], Sprangular.Product)
Expand Down