JustalK/PORTFOLIO

View on GitHub
server/models/jobs.js

Summary

Maintainability
A
1 hr
Test Coverage
'use strict';
 
const mongoose = require('mongoose');
const path = require('path');
const filename = path.basename(__filename, '.js');
 
Similar blocks of code found in 2 locations. Consider refactoring.
const schema = new mongoose.Schema(
{
title: {
type: String,
trim: true,
require: true
}
},
{
timestamps: true,
collection: filename,
toJSON: { virtuals: true },
toObject: { virtuals: true }
}
);
 
module.exports = mongoose.model(filename, schema);