summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/sdk/product.js
blob: a2ba30a1f81ef04337590692691c0645657c4e6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
sdk.product = (function(){
  var product = {}

  product.collection = function(opt){
    $.ajax({
      method: "GET",
      url: sdk.path("Search.API/1.2", "search.json"),
      data: { format: "full", gallery: opt.gallery_id },
      success: opt.success,
      error: opt.error,
    })
  }
  
  // https://gist.github.com/fanfare/2d25d1b36944188948ff
  product.item = function(opt){
    $.ajax({
      method: "GET",
      url: sdk.path("Item.API/1.0", "item/" + opt.code + ".json"),
      success: opt.success,
      error: opt.error,
    })
  }
  
  return product
})()