bef
November 3, 2021, 12:12pm
1
When I use ‘select all records’ and execute an action I get the following error
Unexpected error: Cannot read properties of undefined (reading 'renderingId')
If I only select some entries everything works fine.
My smart action route looks like this:
return new RecordsGetter(myModel, request.myModel, request.query)
.getIdsFromRequest(request)
.then((myModelIds) => myModel.update({ ... }, { where: { id: myModelIds } }))
.then(() => response.send({ success: 'Model updated' }))
.catch(next);
Hi @bef ,
Thank you for reporting this, I’ll try to reproduce the issue.
Could you please tell me your project name, and on which environment (development, production…) you are facing this?
The full error stack would also help if you can copy/paste it.
Thank you
bef
November 3, 2021, 1:33pm
4
I’ll try and send you the error stack
A first lead for you,
When you instantiate the new RecordsGetter
, the second parameter should be the user, not the model.
Please review this snippet in our documentation https://docs.forestadmin.com/documentation/reference-guide/routes/default-routes#get-a-record
bef
November 3, 2021, 1:41pm
6
Thanks a lot that’s the problem.