Skip to content

Commit 74ee9ad

Browse files
authored
Merge pull request #61 from mkessler/master
Fix validation error ID comparison
2 parents 84027ad + a3b2429 commit 74ee9ad

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/util/validation-error-builder.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ export class ValidationErrorBuilder<T extends SpraypaintBase> {
7171
let relatedObject = model[model.klass.deserializeKey(meta.name)]
7272
if (Array.isArray(relatedObject)) {
7373
relatedObject = relatedObject.find(r => {
74-
if (meta["temp-id"] === undefined) return r.id === meta.id
75-
7674
// For now graphiti is returning the related object id as an integer
7775
// where the related object's ID is a string
7876
return (

test/integration/validations.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ describe("validations (3/3)", () => {
401401
detail: "Title cannot be blank",
402402
meta: {
403403
relationship: {
404-
id: "30",
404+
// For some reason graphiti is returning these as integers
405+
id: 30,
405406
// ["temp-id"]: "abc1",
406407
name: "books",
407408
type: "books",

0 commit comments

Comments
 (0)