RecordsGetter serialize returns 'undefined' in route override

Hi,

I’m trying to override a route but getting undefined from RecordsGetter.
Here’s my code:

// Get a list of Dynamic Lists
router.get(
  "/dynamicLists",
  permissionMiddlewareCreator.list(),
  (request, response, next) => {
    // Learn what this route does here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/routes/default-routes#get-a-list-of-records
    const recordsGetter = new RecordsGetter(
      dynamicLists,
      request.user,
      request.query
    );

    recordsGetter
      .getAll(request.query)
      .then((records) => {
        let newRecords = [];
        for (let i = 0; i < records.length; i++) {
          newRecords.push(records[i]);
          newRecords[i].dataValues.coordinates =
            records[i].dataValues.coordinates.coordinates[0] +
            " " +
            records[i].dataValues.coordinates.coordinates[1];
        }
        recordsGetter.serialize(newRecords);
      })
      .then((recordsSerialized) => {
        console.log("recordsSerialized =>", recordsSerialized);
        response.send(recordsSerialized);
      })
      .catch(next);
  }
);

So basically recordsSerialized is undefined from the logs.
It gives the same error using original records (instead of newRecords).
Can anyone please help me?
Thanks heaps

Hi @paolo-dreamwalk and welcome to the community :wave:

I will need your agent version.
Can you please fill those information ?

  • Project name: …
  • Team name: …
  • Environment name: …
  • Agent type & version: …
  • Recent changes made on your end if any: …