2019-11-18 09:03:20 -05:00
|
|
|
const mongoose = require('../infrastructure/Mongoose')
|
2019-05-29 05:21:06 -04:00
|
|
|
const { DocSchema } = require('./Doc')
|
|
|
|
const { FileSchema } = require('./File')
|
|
|
|
|
|
|
|
const { Schema } = mongoose
|
|
|
|
|
2023-02-28 08:26:18 -05:00
|
|
|
const FolderSchema = new Schema(
|
|
|
|
{
|
|
|
|
name: { type: String, default: 'new folder' },
|
|
|
|
},
|
|
|
|
{ minimize: false }
|
|
|
|
)
|
2019-05-29 05:21:06 -04:00
|
|
|
|
|
|
|
FolderSchema.add({
|
|
|
|
docs: [DocSchema],
|
|
|
|
fileRefs: [FileSchema],
|
2021-04-27 03:52:58 -04:00
|
|
|
folders: [FolderSchema],
|
2019-05-29 05:21:06 -04:00
|
|
|
})
|
|
|
|
|
2019-11-18 09:03:20 -05:00
|
|
|
exports.Folder = mongoose.model('Folder', FolderSchema)
|
2019-05-29 05:21:06 -04:00
|
|
|
exports.FolderSchema = FolderSchema
|