verbal-limeV
Refine3y ago
7 replies
verbal-lime

useCustom get request not sending meta populate params (Strapi)

Hi, i'm trying to make a request to get a resource with a relation populated trough the useCustom hook to make the request.

But when the browser sends the request, there are no populate fields param settedf in the request.

I'm using Strapi dataProvider backend.

This is the useCustom call

  const { data } = useCustom<Slot>({
    url: `${apiUrl}/slots/${slotId}`,
    method: 'get',
    meta: {
      populate: ['jobRole']
    },
    queryOptions: {
      enabled: !!slotId
    }
  });


this is the request that the browser sends to the API:

- url: GET http://localhost:1337/api/slots/69?

- response:

{
    "data": {
        "id": 69,
        "attributes": {
            "createdAt": "2023-11-01T18:13:43.973Z",
            "updatedAt": "2023-11-01T18:13:43.973Z",
            "publishedAt": "2023-11-01T18:13:43.973Z"
        }
    },
    "meta": {}
}"
Was this page helpful?