server/models/jobs.js
'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);