0

I have a WordPress server with custom REST API endpoint to receive statistics.

When tested with Postman(API development environment) I get the following expected response:

{
    "stats_daily": {
        "referrals_total": "137",
        "intakes_total": "69",
        "families_total": "40",
        "time": "2/26/2019:07:02:23"  /// MISSING in application, see below
    },
    "time": "2/26/2019:07:02:23",  /// MISSING in application, see below
    "referrals": [
    ...
    ]
}

But in the React web app. The same request results with the following: (console.log)

    families: [{…}]
    intakes: (3) [{…}, {…}, {…}]
    referrals: (11) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
    stats_daily:
       families_total: "22"
       intakes_total: "88"
       referrals_total: "156"
     __proto__: Object
   __proto__: Object

The PROBLEM: It was the same until I added additional field called time. From frustration I added it twice... still the problem is elsewhere.

Somehow it is missing in React App, but can be seen in Postman and in the WordPress relevant Post. Is there some cache involved? What might be the reason? Thanks.

NOTE: 1. The additional data items in console.log output are correct, I just trimmed it from Postman response. Hope its not confusing. 2. No error reported in WordPress server, Nor the application

1 Answer 1

0

The mystery (bug) is simple...

All tests were performed against the production server that did not include the change yet.

I am leaving this here in the hope that it will help someone.

But, if for any reason this question should be deleted - I will delete it. Its just a configuration bug.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.