8000 JS-Data belongsTo broken without inverse relation · Issue #381 · js-data/js-data · GitHub
[go: up one dir, main page]

Skip to content
JS-Data belongsTo broken without inverse relation #381
Closed
@pik

Description

@pik

When defining a one-way relation with belongsTo it errors when it cannot find the inverse relationship - the code below (is from descriptor: { set() })

            const id = utils.get(this, idAttribute)
            const inverseDef = def.getInverse(mapper)

            // e.g. profile.user !== someUser
            // or comment.post !== somePost
            if (currentParent) {
              // e.g. otherUser.profile = undefined
              if (inverseDef.type === hasOneType) {

Failing spec:
pik@aaf9f2c

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0