Hi sorr, I think I might have made you lose your time. That 403 occured because of our client VPN. I found out that after making all the test with him instead of letting him do a todo list.
He had tried on his account with the VPN then without but he still had some cache that made it fails. He then put his VPN back on and tried with the incognito mode. Sorry again.
After all that digging, I found another problem while using the research function on the user table I have that error :
2|admin | [forest] 🌳🌳🌳 Unexpected error: function lower(uuid) does not exist
2|admin | SequelizeDatabaseError: function lower(uuid) does not exist
2|admin | at Query.formatError (/home/ubuntu/releases/20210305201057/forest-admin/node_modules/sequelize/lib/dialects/postgres/query.js:386:16)
2|admin | at Query.run (/home/ubuntu/releases/20210305201057/forest-admin/node_modules/sequelize/lib/dialects/postgres/query.js:87:18)
2|admin | at processTicksAndRejections (internal/process/task_queues.js:93:5)
2|admin | at async /home/ubuntu/releases/20210305201057/forest-admin/node_modules/sequelize/lib/sequelize.js:619:16
2|admin | at async PostgresQueryInterface.rawSelect (/home/ubuntu/releases/20210305201057/forest-admin/node_modules/sequelize/lib/dialects/abstract/query-interface.js:994:18)
2|admin | at async Function.aggregate (/home/ubuntu/releases/20210305201057/forest-admin/node_modules/sequelize/lib/model.js:1986:19)
2|admin | at async Function.count (/home/ubuntu/releases/20210305201057/forest-admin/node_modules/sequelize/lib/model.js:2037:12)
My table definition is
const User = sequelize.define(
'users',
{
id: {
type: DataTypes.UUID,
primaryKey: true,
defaultValue: Sequelize.literal('uuid_generate_v4()'),
allowNull: false,
},
email: {
type: DataTypes.STRING,
},
firstname: {
type: DataTypes.STRING,
defaultValue: '',
validate: {
is: /^[a-zA-Z\p{L}' -]*$/u,
},
// This is needed to set empty strings. (see https://community.forestadmin.com/t/cant-save-not-null-fields-with-empty-strings/1091/3.)
set(val) {
this.setDataValue('firstname', val || '');
},
},
},
{
tableName: 'users',
underscored: true,
timestamps: false,
schema: process.env.DATABASE_SCHEMA,
},
);
It is linked to two other tables :
User.associate = (models) => {
User.belongsTo(models.accounts);
User.hasMany(models.consents, {
foreignKey: 'created_by_user_id',
as: 'authoredConsent',
});
User.belongsToMany(models.patients, { through: models.consents });
User.belongsToMany(models.locations, { through: models.locationsUsers, foreignKey: 'user_id', otherKey: 'location_id' });
};
and it has a beforeUpdate rule that does not use the id.
I don’t know what I’m doing wrong