Wednesday, August 21, 2019 9:53:42 AM
  • Posted: Thursday, March 28, 2019 8:57 AM
  • 25
Hi

We are still working on the API. I have struggled with this issue for some time now and realize I might just ask for help.

Problem is assigning category to product . This gives 200/OK but is not updated in MongoDB.

Do you see what the problem might be?

Testing for this product (ID 5c9c2e851c149e000188462f)

[url=https://ibb.co/fDTf7pZ][/url]


...and this category (ID 5c6697123945712d04312c17)

[url=https://ibb.co/Yykk5rk][/url]

Fiddler POST request gives 200 OK

[url=https://ibb.co/Tc7CK1x][/url]

...but DB is not updated

[url=https://ibb.co/fn88zqx][/url]


Can you see the problem?
Will appreciate any help on this!

Also, some suggestions
1) Article / guide on how to set up sandbox for testing/debugging API requests
2) Possible to define relations to Categories/Pictures etc in "main" JSON for Insert/Update product (I understand it's not possible today)
0
  • Posted: Thursday, March 28, 2019 9:19 AM
  • Moderator
  • 295
Hi,

Thanks for post. If Fiddler returns status 200 ok, it should be everything fine. I tested it while ago on my test environment and everything was ok. I updated the product category. To check the database, I used the Robo 3T tool and after API request, I had to run query again, in the other case I didn't see updated results. Did you run query again in your MongoDB GUI tool?

Thanks for suggestions.  

Best,
Patryk
0
  • Posted: Saturday, March 30, 2019 5:06 AM
  • 25
Thx for your reply (and sorry about failed image formatting above).

We're using MongoExpress and I have confirmed that data is not updated in the database, even if HTTP gives 200/OK.  

Also checked this product in the front store UI (no category assigned).

We were able to update product name for product via API, so DB connection is to be OK.

There is always an explaination for issues like this.  Please check what "states" could give 200/OK without updating the DB.

We will try to set up the API as a local api test sandbox as mentioned, but I guess this will take some time.
0