Validation
import type { Agent } from '@forestadmin/forest-cloud';
import { Schema } from '../typings';
export default function customizeAgent(agent: Agent<Schema>) {
agent.customizeCollection('users', (collection) => {
// Insert the code snippet here.
});
}collection
.addFieldValidation('first_name', 'Present')
.addFieldValidation('first_name', 'LongerThan', 2)
.addFieldValidation('first_name', 'ShorterThan', 13)
.addFieldValidation('first_name', 'Match', /^[a-z]+$/i);Last updated