Skip to content

Commit 819fee0

Browse files
Bump version to 21 ready to release
1 parent bbe5101 commit 819fee0

5 files changed

+22
-29
lines changed

dist/js-data-jsonapi.js

+17-24
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* js-data-jsonapi
3-
* @version 0.0.0-alpha.20 - Homepage <https://github.com/BlairAllegroTech/js-data-jsonapi>
3+
* @version 0.0.0-alpha.21 - Homepage <https://github.com/BlairAllegroTech/js-data-jsonapi>
44
* @author Blair Jacobs
55
* @copyright (c) 2016-2017 Blair Jacobs
66
* @license MIT <https://github.com/BlairAllegroTech/js-data-jsonapi/blob/master/LICENSE>
@@ -324,11 +324,11 @@ return /******/ (function(modules) { // webpackBootstrap
324324
exports.TryGetMetaData = TryGetMetaData;
325325
;
326326
exports.version = {
327-
full: '0.0.0-alpha.20',
327+
full: '0.0.0-alpha.21',
328328
major: parseInt('0', 10),
329329
minor: parseInt('0', 10),
330330
patch: parseInt('0', 10),
331-
alpha: true ? '20' : false,
331+
alpha: true ? '21' : false,
332332
beta: true ? 'false' : false
333333
};
334334
//# sourceMappingURL=JsonApiAdapter.js.map
@@ -503,25 +503,23 @@ return /******/ (function(modules) { // webpackBootstrap
503503
return (relation && relation[0]) ? relation[0] : null;
504504
};
505505
SerializationOptions.prototype.getChildRelationWithLocalField = function (relationType, localFieldName) {
506-
relationType = relationType.toLowerCase();
507-
localFieldName = localFieldName.toLowerCase();
506+
var localFieldNameLower = localFieldName.toLowerCase();
508507
var relations = this.getChildRelations(relationType);
509508
var match = null;
510509
DSUTILS.forEach(relations, function (relation) {
511-
if (relation.localField === localFieldName) {
510+
if (relation.localField === localFieldName || relation.localField === localFieldNameLower) {
512511
match = relation;
513512
return false;
514513
}
515514
});
516515
return match;
517516
};
518517
SerializationOptions.prototype.getChildRelationWithForeignKey = function (relationType, foreignKeyName) {
519-
relationType = relationType.toLowerCase();
520-
foreignKeyName = foreignKeyName.toLowerCase();
518+
var foreignKeyNameLower = foreignKeyName.toLowerCase();
521519
var relations = this.getChildRelations(relationType);
522520
var match = null;
523521
DSUTILS.forEach(relations, function (relation) {
524-
if (relation.foreignKey === foreignKeyName) {
522+
if (relation.foreignKey === foreignKeyName || relation.foreignKey === foreignKeyNameLower) {
525523
match = relation;
526524
return false;
527525
}
@@ -548,29 +546,23 @@ return /******/ (function(modules) { // webpackBootstrap
548546
});
549547
};
550548
SerializationOptions.prototype.getChildRelations = function (relationType) {
551-
relationType = relationType.toLowerCase();
552549
if (this.resourceDef.relations) {
553-
if (this.resourceDef.relations.hasOne) {
554-
if (this.resourceDef.relations.hasOne[relationType]) {
555-
return this.resourceDef.relations.hasOne[relationType];
556-
}
557-
}
558-
if (this.resourceDef.relations.hasMany) {
559-
if (this.resourceDef.relations.hasMany[relationType]) {
560-
return this.resourceDef.relations.hasMany[relationType];
561-
}
562-
}
563550
var relationlower_1 = relationType.toLowerCase();
564551
var matches_1 = [];
565552
var relationList = this.resourceDef.relationList;
566553
DSUTILS.forEach(relationList, function (relation) {
567554
if (relation.type === jsDataHasMany || relation.type === jsDataHasOne) {
568-
if (relationlower_1 === relation.relation) {
555+
if (relationType === relation.relation) {
569556
matches_1.push(relation);
570557
}
558+
else {
559+
if (relationlower_1 === relation.relation) {
560+
matches_1.push(relation);
561+
LogInfo('Relation Case Insensitive match made of ' + relationType, matches_1);
562+
}
563+
}
571564
}
572565
});
573-
LogInfo('Relation Case Insensitive match made of ' + relationType, matches_1);
574566
return matches_1;
575567
}
576568
return null;
@@ -580,7 +572,7 @@ return /******/ (function(modules) { // webpackBootstrap
580572
var relationList = this.resourceDef.relationList;
581573
var match = null;
582574
DSUTILS.forEach(relationList, function (relation) {
583-
if (relation.localField === relationlower) {
575+
if (relation.localField === relationName || relation.localField === relationlower) {
584576
match = relation;
585577
return false;
586578
}
@@ -1205,7 +1197,8 @@ return /******/ (function(modules) { // webpackBootstrap
12051197
if (data.type && data.GetSelfLink && data.GetSelfLink()) {
12061198
var selfLinkArray = data.GetSelfLink().split('/');
12071199
options.enumerateAllParentRelations(function (rel) {
1208-
var parentResourceIndex = selfLinkArray.lastIndexOf(rel.relation);
1200+
var parentDefinition = options.getResource(rel.relation);
1201+
var parentResourceIndex = selfLinkArray.lastIndexOf(parentDefinition.def().endpoint);
12091202
if (parentResourceIndex >= 0 && rel.localKey) {
12101203
fields[rel.localKey] = selfLinkArray[parentResourceIndex + 1];
12111204
var parentLink = selfLinkArray.slice(0, parentResourceIndex + 2).join('/');

dist/js-data-jsonapi.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js-data-jsonapi.min.map

+1-1
Large diffs are not rendered by default.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-data-jsonapi",
3-
"version": "0.0.0-alpha.20",
3+
"version": "0.0.0-alpha.21",
44
"description": "JsonApi adapter for js-data.",
55
"main": "./dist/js-data-jsonapi.js",
66
"repository": {

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Or alternatively to use an existing HttpAdapter for example when using js-data-a
6969
```
7070
7171
### Version
72-
0.0.0-alpha.20
72+
0.0.0-alpha.21
7373
7474
### Tech
7575

0 commit comments

Comments
 (0)