Skip to content

Commit

Permalink
Merge pull request #61 from mkessler/master
Browse files Browse the repository at this point in the history
Fix validation error ID comparison
  • Loading branch information
richmolj authored Mar 18, 2020
2 parents 84027ad + a3b2429 commit 74ee9ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/util/validation-error-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ export class ValidationErrorBuilder<T extends SpraypaintBase> {
let relatedObject = model[model.klass.deserializeKey(meta.name)]
if (Array.isArray(relatedObject)) {
relatedObject = relatedObject.find(r => {
if (meta["temp-id"] === undefined) return r.id === meta.id

// For now graphiti is returning the related object id as an integer
// where the related object's ID is a string
return (
Expand Down
3 changes: 2 additions & 1 deletion test/integration/validations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ describe("validations (3/3)", () => {
detail: "Title cannot be blank",
meta: {
relationship: {
id: "30",
// For some reason graphiti is returning these as integers
id: 30,
// ["temp-id"]: "abc1",
name: "books",
type: "books",
Expand Down

0 comments on commit 74ee9ad

Please sign in to comment.