Permalink
Browse files

fix(association-select): use resource instead of property, check for …

…all falsy values in isNew instead only undefined
  • Loading branch information...
VMBindraban
VMBindraban committed Aug 19, 2016
1 parent 5667456 commit 8063c11207c309d37521b21f4dc9647fd0932e21
Showing with 3 additions and 4 deletions.
  1. +2 −3 src/component/association-select.js
  2. +1 −1 src/entity.js
@@ -24,7 +24,7 @@ export class AssociationSelect {
@bindable manyAssociation;
@bindable({defaultBindingMode: bindingMode.twoWay}) value ;
@bindable({defaultBindingMode: bindingMode.twoWay}) value;
@bindable({defaultBindingMode: bindingMode.twoWay}) error;
@@ -127,8 +127,7 @@ export class AssociationSelect {
// When disabling populate here, the API won't return any data.
delete criteria.populate;
let property = this.propertyForResource(assoc.getMeta(), repository.getResource());
findPath = `${assoc.getResource()}/${assoc.getId()}/${property}`;
findPath = `${assoc.getResource()}/${assoc.getId()}/${findPath}`;
} else if (this.association) {
let associations = Array.isArray(this.association) ? this.association : [this.association];
@@ -342,7 +342,7 @@ export class Entity {
* @return {boolean}
*/
isNew() {
return typeof this.getId() === 'undefined';
return !this.getId();
}
/**

0 comments on commit 8063c11

Please sign in to comment.