huridocs/uwazi

View on GitHub
app/api/relationships.v2/routes/validators/deleteRelationshipMigrationFields.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { createValidator, ValidatorSchema } from 'api/common.v2/validation/routesValidation';
import { DeleteRelationshipMigrationFieldRequest } from 'shared/types/api.v2/relationshipMigrationField.delete';

const schema: ValidatorSchema<DeleteRelationshipMigrationFieldRequest> = {
  properties: {
    sourceTemplate: {
      type: 'string',
    },
    relationType: {
      type: 'string',
    },
  },
  optionalProperties: {
    targetTemplate: {
      type: 'string',
    },
  },
};

export const validateDeleteRelationshipMigrationField = createValidator(schema);