Subversion Repositories SmartDukaan

Rev

Rev 13560 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
13542 anikendra 1
angular.module('starter.services', [])
13563 anikendra 2
.value('apihost',"http://api.profittill.com/")
3
.factory('UserAction',function($resource,apihost){
4
    return $resource(apihost+"/user_actions/update/:user_id/:store_product_id/:action",
5
        {callback: "JSON_CALLBACK"} ,
6
        { like: {
7
                method: "JSONP",
8
            }           
9
        }
10
    )})
11
.factory('RemAction',function($resource,apihost){
12
    return $resource(apihost+"/user_actions/rem/:user_id/:store_product_id/:action",
13
        {callback: "JSON_CALLBACK"} ,
14
        { rem: {
15
                method: "JSONP",
16
            }               
17
        }
18
    )})
19
.factory('Myactions', function($resource,apihost) {
20
    return $resource(apihost+"/user_actions/by/:user_id",
21
        {callback: "JSON_CALLBACK"} , 
22
        { all: {
23
            method: "JSONP",
24
           }
25
        }
26
    )})  
13542 anikendra 27
.factory('Categories', function($resource,apihost) {
28
  return $resource(apihost+"/categories/?user_id=:me",
29
      {callback: "JSON_CALLBACK"} , 
30
      { all: {
31
          method: "JSONP",
32
         }
33
      }
34
  )}) 
35
.factory('Products', function($resource,apihost) {
13551 anikendra 36
  return $resource(apihost+"store_products/index/:me/page:"+":page",
13542 anikendra 37
      {callback: "JSON_CALLBACK"} , 
38
      { all: {
39
          method: "JSONP",
40
         }
41
      }
42
  )}) 
43
.factory('CategoryProducts', function($resource,apihost) {
13551 anikendra 44
  return $resource(apihost+"store_products/bycategory/:me/page:"+":page",
13542 anikendra 45
      {callback: "JSON_CALLBACK"} , 
46
      { all: {
47
          method: "JSONP",
48
         }
49
      }
13560 anikendra 50
  )}) 
51
.factory('Clicks', function($resource,apihost) {
52
  return $resource(apihost+"clicks/add/:me/:id",
53
      {callback: "JSON_CALLBACK"} , 
54
      { get: {
55
          method: "JSONP",
56
         }
57
      }
58
  )});