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

Revert Breaks $_JSONAPIMETA_ #36

Open
rgant opened this issue Jan 26, 2017 · 2 comments
Open

Revert Breaks $_JSONAPIMETA_ #36

rgant opened this issue Jan 26, 2017 · 2 comments

Comments

@rgant
Copy link
Contributor

rgant commented Jan 26, 2017

Calling DS#revert on a js-data-jsonapi resource reverts some of the $_JSONAPIMETA_ breaking relationships. More details to follow.

@BlairAllegroTech
Copy link
Owner

Glad you're back....
I must admit i haven't been working on this project but I'll start getting back into it again..

@rgant
Copy link
Contributor Author

rgant commented Feb 6, 2017

Sorry this took me a bit to get. Here is a JSON dump of the Users Resource before revert:

{
    "phone": "123",
    "type": "admin",
    "created_at": "2016-06-11T13:46:39+00:00",
    "notification_dt": null,
    "last_name": "McTesty",
    "updated_at": "2016-12-19T21:49:55+00:00",
    "email": "test.mctesty@example.com",
    "first_name": "Test",
    "title": "1321",
    "email_status": {},
    "id": "1566",
    "$_JSONAPIMETA_": {
        "selfType": "users",
        "selfLink": "/v3/users/me",
        "isJsonApiReference": false,
        "relationships": {
            "account": {
                "related": {
                    "type": "accounts",
                    "url": "/v3/users/me/account"
                }
            }
        },
        "links": {
            "self": {
                "type": "self",
                "url": "/v3/users/me",
                "meta": {}
            }
        },
        "referenceCount": 1
    }
}

And here is after revert:

{
    "phone": "123",
    "type": "admin",
    "created_at": "2016-06-11T13:46:39+00:00",
    "notification_dt": null,
    "last_name": "McTesty",
    "updated_at": "2016-12-19T21:49:55+00:00",
    "email": "test.mctesty@example.com",
    "first_name": "Test",
    "title": "1321",
    "email_status": {},
    "id": "1566",
    "$_JSONAPIMETA_": {
        "selfType": "users",
        "selfLink": "/v3/users/me",
        "isJsonApiReference": false,
        "relationships": {},
        "links": {
            "self": {
                "type": "self",
                "url": "/v3/users/me",
                "meta": {}
            }
        },
        "referenceCount": 1
    }
}

It looks like for some reason relationships is cleared.

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

No branches or pull requests

2 participants