Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Sending custom status clears body #93

Closed
jasperblues opened this issue Jan 31, 2019 · 5 comments
Closed

Sending custom status clears body #93

jasperblues opened this issue Jan 31, 2019 · 5 comments

Comments

@jasperblues
Copy link

No description provided.

@jasperblues
Copy link
Author

module.exports = {
    path: '/api/customers',
    template: {
        data: {
            id: uuid(),
            type: "customer",
            attributes: {
                project: "ZZ",
                network: "ZZ",
                customer_id: uuid(),
                project_group_id: null,
                customer_name: g.name(),
                is_active: "Y",
                currency: "USD",
                ar_customer_id: null,
                payer_name: null,
                payer_email: null,
                fein: null,
                external_customer_id: null
            }
        }
    },
    status: (req, res, next) => {
        res.status(HttpStatus.CREATED);
        next(); 
    }
};

Expected:

Body is returned.

Actual:

Empty body.

@webpro
Copy link
Owner

webpro commented Jan 31, 2019

That's weird. Probably I'll have some time to look into this in the coming days.

@webpro
Copy link
Owner

webpro commented Feb 2, 2019

What I suspect is going on, is that you're getting a cached response. GET responses are cached by default. So please try to either set cache: false or use a different endpoint path.

@webpro
Copy link
Owner

webpro commented Feb 2, 2019

@webpro
Copy link
Owner

webpro commented Mar 25, 2019

Closing due to inactivity.

@webpro webpro closed this as completed Mar 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants