Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
fix(Repository): define variable dataType
Browse files Browse the repository at this point in the history
  • Loading branch information
RWOverdijk authored Oct 17, 2018
1 parent 0086a0a commit 6c97663
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,14 @@ export class Repository {
let value = data[key];

if (entityMetadata.has('types', key)) {
const dataType = entityMetadata.fetch('types', key);

if (dataType === 'date' || dataType === 'datetime') {
if (value) {
populatedData[key] = typer.default.cast(value, dataType);
}
} else {
populatedData[key] = typer.cast(value, entityMetadata.fetch('types', key));
populatedData[key] = typer.cast(value, dataType);
}

continue;
Expand Down

0 comments on commit 6c97663

Please sign in to comment.