RecordsGetter is not defined Error

Hi team,

Im trying add new smart action for set valid our records. But i get error " RecordsGetter is not defined"

I tried two case,

Case 1:

router.post('/actions/mark-is-live', permissionMiddlewareCreator.smartAction(), (request, response) => {
    return new RecordsGetter(wegPvmPvmModel).getIdsFromRequest(request)
        .then((id) => {
            return wegPvmPvmModel.update({is_valid: true}, {where: {id: id}})
                .then(() => {
                    response.send({success: true});
                })
        });
});

Case 2:

router.post('/actions/mark-as-live', permissionMiddlewareCreator.smartAction(), (req, res) => {
  const recordsGetter = new RecordsGetter(wegPvmPvmModel, request.user, request.query);
  
  return recordsGetter.getIdsFromRequest(req)
    .then(companyIds => companies.update({ status: 'live' }, { where: { id: companyIds }}))
    .then(() => res.send({ success: 'Company is now live!' }));
});

Can you help me please?

Thanks,
Cem

Hi @Cem_Kuleyin :wave: did you import RecordsGetter from forest-express-sequelize or forest-express-mongoose like below.

const { RecordsGetter } = require('forest-express-sequelize');

Let me know if that help.

1 Like

hi @Arnaud_Moncel,

thanks for solution. your solution is fix our problem.

Kind regards,

Cem.