Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hasOne relations aren't found in store for newly added records #572

Open
zuzusik opened this issue Jul 2, 2020 · 0 comments · May be fixed by #575
Open

hasOne relations aren't found in store for newly added records #572

zuzusik opened this issue Jul 2, 2020 · 0 comments · May be fixed by #575

Comments

@zuzusik
Copy link
Contributor

zuzusik commented Jul 2, 2020

Description

Environment

  • js-data version: latest
  • node or browser version: any
  • operating system: any

Steps to reproduce

try adding records to store which have hasOne relation and there are already related records in store - related records won't be linked to newly added records

Cause

The implementation of findExistingLinksFor is incorrect for hasOne relation:

findExistingLinksFor (relatedMapper, record) {

where it's being called like this:

relatedData = this.findExistingLinksFor(record)

so, as it's seen - first argument should be a record, and second argument even never passed

to compare, this is the impl of this method for hasMany:

findExistingLinksFor (record) {

@patricklx patricklx linked a pull request Mar 26, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant