0.1.6 • Published 12 months ago

strapi-plugin-untransform-response v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

strapi-plugin-untransform-response

@strapi/* ^4.6.0

What it does:

Efficiently removes all the unnecessary data/attributes tags.

Installation

yarn add strapi-plugin-untransform-response

or

npm install strapi-plugin-untransform-response
// DON'T FORGET
yarn strapi build

Before

{
  "data": {
    "id": 1,
    "attributes": {
      "title": "Some title",
      "relations": {
        "data": [
          {
            "id": 2,
            "attributes": {
              "title": "Some other title"
            }
          }
        ]
      }
    }
  },
  "meta": { ... }
}

After

{
  "data": {
    "id": 1,
    "title": "Some title",
    "relations": [
      {
        "id": 2,
        "title": "Some other title"
      }
    ]
  },
  "meta": { ... }
}

Settings

Settings are unnecessary, unless you want to disable plugin.

/config/plugins.ts

export default ({ env }) => ({
  ...,
  'strapi-plugin-untransform-response': {
    enabled: false,  // TO DISABLE
  },
  ...,
});

Known issues

gql is not supported.

Currently overrides all transformResonse functions, in all controllers, so be advised.

0.1.6

12 months ago

0.1.5

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago