'use strict';

//products service used for communicating with the schools REST endpoints
angular.module('products').factory('Products', ['$resource',
  function($resource) {
    return $resource('api/products/:productId', {
      productId: '@id'
    }, {
      update: {
        method: 'PUT'
      },
      getProducts: {
        url: 'api/:schoolIdProduct/products/:Type',
        params: {
          schoolIdProduct: ':schoolIdProduct',
          Type: ':Type'
        },
        isArray: true
      },
      createProvider: {
        url: '/api/provider/products',
        method: 'POST',
      },
    });
  }
]);