LogoRobo.js
Framework

validateForeignKeys()

Function: validateForeignKeys()

function validateForeignKeys(
   modelName, 
   schema, 
   data, 
   getModel, 
updatedFields?): Promise<void>

Validate all foreign keys in a record's data.

Parameters

ParameterTypeDescription
modelNamestringModel name
schemaNormalizedSchemaNormalized schema
dataRecord<string, unknown>Record data being created/updated
getModel(name) => unknownFunction to get model instance by name
updatedFields?Set<string>Set of fields being updated (for update validation)

Returns

Promise<void>

On this page