How can I give "type:richtext" to the schema inside the schema?

Viewed 19

I have 2 files: service.admin.js and service.entity.js Since I wanted to write the description in 3 languages, I created the DescriptionShema. but I want to make DescriptionShema "type:richtext". How can I do this in service.admin.js? This is my code : service.entity.js:

const mongoose = require('mongoose');

const DescriptionSchema = mongoose.Schema({
   AZ: String,
   ENG: String,
   RU: String,
});

const ServiceSchema = new mongoose.Schema({
   description: {
      type: DescriptionSchema,
      required: true,
   }
});

const Service = mongoose.model('Service', ServiceSchema);

module.exports = { ServiceSchema, Service };

serivce.admin.js :

const AdminBro = require('admin-bro');
const { Service } = require('./service.entity');

/** @type {AdminBro.ResourceOptions} */
const options = {
   properties: {
      _id: {
         isVisible: false,
      }
   }
};

module.exports = {
   options,
   resource: Service,
};

How can I change the type of DescriptionShema inside properties?

0 Answers
Related