question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calling Moltin.Products.UpdateRelationships(moltinId, 'category', []) fails

See original GitHub issue

Hi!

Calling await Moltin.Products.UpdateRelationships(moltinId, 'category', []) to clear all Product <=> Category relationships fails with the following error:

{
    "message": {
        "errors": [
            {
                "status": 500,
                "title": "Internal Server Error",
                "detail": "There was an internal server error, you can report with your request id.",
                "request_id": "6c8b4050dc4c0eb2"
            }
        ]
    }
}

Although a PUT request directly placed to the endpoint works.

Take a look at the code here on Line: 8

https://github.com/moltin/js-sdk/blob/6ebcb9985221a3dfc11fdf2b4ed6bae963167594/src/utils/helpers.js#L4-L16

All other return statements return an Array whereas, this line returns a string. Which I suppose is again converted to JSON string with JSON.stringify(body) resulting in "[]" instead of []

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ynnojcommented, Sep 7, 2017

Looks like your hypothesis is correct! 😄

1reaction
aravindanvecommented, Sep 7, 2017

I’m using it in the backend. I need to do a quick browser test to get the request payload from the sdk. Hold on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Category Relationship - Elastic Path Documentation
Create a Product relationship to one or more Categories. If any relationships already exist, the ones made in the request are added to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found