From d0dedb50bc13db5d2ff794eafc493d5ea0b59e62 Mon Sep 17 00:00:00 2001 From: Timothy Ruhle Date: Thu, 7 Jan 2016 14:42:20 +1000 Subject: [PATCH] Allowing sub_path for view calls --- bower.json | 2 +- dist/rest-api/rest-api.js | 2 +- package.json | 2 +- src/rest-api/rest-api.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index 4957a46..d3c489a 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "angular-cakephp", "description": "An AngularJS data modelling framework that ties in with a CakePHP REST API", - "version": "0.5.1", + "version": "1.1.0", "homepage": "https://github.com/intellipharm/angular-cakephp", "repository": { "type": "git", diff --git a/dist/rest-api/rest-api.js b/dist/rest-api/rest-api.js index 6e34f80..9127db5 100644 --- a/dist/rest-api/rest-api.js +++ b/dist/rest-api/rest-api.js @@ -128,7 +128,7 @@ System.register(['lodash', '../angular-cakephp'], function (_export) { // request config request_config.method = 'GET'; - request_config.sub_path = id; + request_config.sub_path = _.has(request_config, 'sub_path') ? id + '/' + request_config.sub_path : id; // request ... return this.request(active_record_class, request_config); diff --git a/package.json b/package.json index 694a69f..6967c57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-cakephp", - "version": "1.0.1", + "version": "1.1.0", "main": "dist/angular-cakephp.js", "scripts": { "postinstall": "jspm install" diff --git a/src/rest-api/rest-api.js b/src/rest-api/rest-api.js index 3acacf2..9baa915 100644 --- a/src/rest-api/rest-api.js +++ b/src/rest-api/rest-api.js @@ -241,7 +241,7 @@ class RestApi { // request config request_config.method = 'GET'; - request_config.sub_path = id; + request_config.sub_path = _.has( request_config, 'sub_path' ) ? id + '/' + request_config.sub_path : id; // request ... return this.request( active_record_class, request_config );