Update validation callbacks' debug page

The API for validation callbacks changed some time ago and the debug page was not updated to reflect this.
This commit is contained in:
Apollinaire 2019-01-10 15:12:19 +01:00
parent ce8e29fc5b
commit ac2349f2ff

View file

@ -207,11 +207,12 @@ const registerCollectionCallbacks = (typeName, options) => {
if (options.create) {
registerCallback({
name: `${typeName}.create.validate`,
iterator: { document: 'The document being inserted' },
iterator: { validationErrors: 'An array that can be used to accumulate validation errors' },
properties: [
{ document: 'The document being inserted' },
{ currentUser: 'The current user' },
{ validationErrors: 'An object that can be used to accumulate validation errors' },
{ collection: 'The collection the document belongs to' },
{ context: 'The context of the mutation'},
],
runs: 'sync',
returns: 'document',
@ -248,11 +249,13 @@ const registerCollectionCallbacks = (typeName, options) => {
if (options.update) {
registerCallback({
name: `${typeName}.update.validate`,
iterator: { data: 'The client data' },
iterator: { validationErrors: 'An object that can be used to accumulate validation errors' },
properties: [
{ document: 'The document being edited' },
{ data: 'The client data' },
{ currentUser: 'The current user' },
{ validationErrors: 'An object that can be used to accumulate validation errors' },
{ collection: 'The collection the document belongs to' },
{ context: 'The context of the mutation'},
],
runs: 'sync',
returns: 'modifier',
@ -296,10 +299,12 @@ const registerCollectionCallbacks = (typeName, options) => {
if (options.delete) {
registerCallback({
name: `${typeName}.delete.validate`,
iterator: { document: 'The document being removed' },
iterator: { validationErrors: 'An object that can be used to accumulate validation errors' },
properties: [
{ currentUser: 'The current user' },
{ validationErrors: 'An object that can be used to accumulate validation errors' },
{ document: 'The document being removed' },
{ collection: 'The collection the document belongs to'},
{ context: 'The context of this mutation'}
],
runs: 'sync',
returns: 'document',