Skip to content

Commit

Permalink
Merge branch 'Dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Arteha committed Dec 30, 2019
2 parents d860a1e + a2644de commit d63c8cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "admin-bro-typeorm",
"version": "0.1.6-alpha.5",
"version": "0.1.6-alpha.6",
"description": "TypeORM adapter for AdminBro",
"keywords": [
"typeorm",
Expand Down
10 changes: 5 additions & 5 deletions src/Resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,16 @@ export class Resource extends BaseResource
for (const p in params)
{
const property = this.property(p);
if(property && params[p])
if(property)
{
if(["mixed", "boolean"].includes(property.type()))
params[p] = JSON.parse(params[p]);
params[p] = !params[p] ? null : JSON.parse(params[p]);
else if(["number", "float"].includes(property.type()))
params[p] = Number(params[p]);
params[p] = !params[p] ? null : Number(params[p]);
else if(["date", "datetime"].includes(property.type()))
params[p] = new Date(params[p]);
params[p] = !params[p] ? null : new Date(params[p]);
else if(property.type() == "reference")
params[property.column.propertyName] = +params[p];
params[property.column.propertyName] = !params[p] ? null : +params[p];
}
}
return params;
Expand Down

0 comments on commit d63c8cb

Please sign in to comment.