Skip to content

Commit

Permalink
Bugfix: Respect floats
Browse files Browse the repository at this point in the history
  • Loading branch information
phortx committed May 8, 2018
1 parent b24af6f commit ac3bc62
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/vuex-orm-apollo.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -9392,7 +9392,7 @@ var QueryBuilder = /** @class */ (function () {
}
}
else if (model.fieldIsNumber(model.fields.get(key))) {
result[key] = parseInt(data[key], 0);
result[key] = parseFloat(data[key]);
}
else if (key.endsWith('Type') && model.isTypeFieldOfPolymorphRelation(key)) {
result[key] = inflection.pluralize(downcaseFirstLetter(data[key]));
Expand Down
2 changes: 1 addition & 1 deletion src/queryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default class QueryBuilder {
result[newKey] = this.transformIncomingData(data[key], localModel, mutation, true);
}
} else if (model.fieldIsNumber(model.fields.get(key))) {
result[key] = parseInt(data[key], 0);
result[key] = parseFloat(data[key]);
} else if (key.endsWith('Type') && model.isTypeFieldOfPolymorphRelation(key)) {
result[key] = inflection.pluralize(downcaseFirstLetter(data[key]));
} else {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/QueryBuilder.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ describe('QueryBuilder', () => {
"id": "15",
"name": "Charly Brown"
},
"otherId": "4894",
"otherId": "4894.35",
"comments": {
"nodes": [
{
Expand Down Expand Up @@ -343,7 +343,7 @@ describe('QueryBuilder', () => {
"id": 15,
"name": "Charly Brown"
},
"otherId": 4894,
"otherId": 4894.35,
"comments": [
{
"$isPersisted": true,
Expand Down

0 comments on commit ac3bc62

Please sign in to comment.