Skip to content

Commit

Permalink
fix(entity-editor): avoid NaN values if edition physical data is unset
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSputnik committed Nov 25, 2017
1 parent 8cb171c commit 9c3890a
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/server/routes/entity/edition.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,22 +350,29 @@ function transformNewForm(data) {

return {
aliases,
depth: parseInt(data.editionSection.depth, 10),
depth: data.editionSection.depth &&
parseInt(data.editionSection.depth, 10),
disambiguation: data.nameSection.disambiguation,
formatId: parseInt(data.editionSection.format, 10),
height: parseInt(data.editionSection.height, 10),
formatId: data.editionSection.format &&
parseInt(data.editionSection.format, 10),
height: data.editionSection.height &&
parseInt(data.editionSection.height, 10),
identifiers,
languages,
note: data.submissionSection.note,
pages: parseInt(data.editionSection.pages, 10),
pages: data.editionSection.pages &&
parseInt(data.editionSection.pages, 10),
publicationBbid: data.editionSection.publication &&
data.editionSection.publication.id,
publishers: data.editionSection.publisher &&
[data.editionSection.publisher.id],
releaseEvents,
statusId: parseInt(data.editionSection.status, 10),
weight: parseInt(data.editionSection.weight, 10),
width: parseInt(data.editionSection.width, 10)
statusId: data.editionSection.status &&
parseInt(data.editionSection.status, 10),
weight: data.editionSection.weight &&
parseInt(data.editionSection.weight, 10),
width: data.editionSection.width &&
parseInt(data.editionSection.width, 10)
};
}

Expand Down

0 comments on commit 9c3890a

Please sign in to comment.