Skip to content

Why is this package stripping content out of the request body? #18

@braco

Description

@braco

I threw some console.logs into your fetch package after tearing my hair out over acf fields not making it through the request.

Code:

api.customType().create({
          title: { raw },
          content: {  raw },
          acf: { field1, field2 },
          foo: 'bar',
});

Actual fetch:

{
  url: 'wp/v2/customType',
  body: '{ "title":"...", "content":"...", "foo":"bar" }',
  method: 'post'
}

What could be the reason for this?

delete body.acf

Additionally, it was difficult to figure out what the create() JSON format was supposed to look like (not title:"" but title:{raw}), as there are no full examples in the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions