P
P
picka2021-07-26 00:16:52
React
picka, 2021-07-26 00:16:52

How to request data from the Strapi API?

I have an API built on Strapi CMS. /products comes with objects like this:

{
  "id": 1,
  "name": "Тест",
  "popularity": 4,
  "published_at": "2021-07-22T20:18:08.000Z",
  "created_at": "2021-07-11T23:33:52.000Z",
  "updated_at": "2021-07-22T21:16:03.000Z",
  "slug": "test",
  "price": 3000,
  "sale": 2000,
  "variations": [
    {
      "id": 1,
      "color": {
        "id": 1,
        "name": "Черный",
        "slug": "chernyj",
        "published_at": "2021-07-22T20:00:25.000Z",
        "created_at": "2021-07-22T20:00:24.000Z",
        "updated_at": "2021-07-22T21:04:07.000Z",
        "hex": "#000000"
      },
    }
}


How can I filter products by a specific color via a GET request?

I managed to filter by price, example:
https://domain.com/products?price=2000

But this cannot be done with an array

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question