huridocs/uwazi

View on GitHub
app/api/relationtypes/model.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import mongoose from 'mongoose';
import { instanceModel } from 'api/odm';

const propertiesSchema = new mongoose.Schema({
  id: String,
  label: String,
  type: String,
  content: String,
  name: String,
  filter: Boolean,
  required: Boolean,
  sortable: Boolean,
  showInCard: Boolean,
  prioritySorting: Boolean,
  nestedProperties: [String],
});

const templateSchema = new mongoose.Schema({
  name: String,
  properties: [propertiesSchema],
});

export default instanceModel('relationtypes', templateSchema);