removes mongoose-hidden, updates globals accordingly
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
const mongoose = require('mongoose');
|
||||
const mongooseHidden = require('mongoose-hidden')();
|
||||
const buildSchema = require('../mongoose/buildSchema');
|
||||
const localizationPlugin = require('../localization/plugin');
|
||||
|
||||
@@ -11,8 +10,6 @@ const buildModel = (config) => {
|
||||
globalsSchema.plugin(localizationPlugin, config.localization);
|
||||
}
|
||||
|
||||
globalsSchema.plugin(mongooseHidden);
|
||||
|
||||
const Globals = mongoose.model('globals', globalsSchema);
|
||||
|
||||
Object.values(config.globals).forEach((globalConfig) => {
|
||||
@@ -22,8 +19,6 @@ const buildModel = (config) => {
|
||||
globalSchema.plugin(localizationPlugin, config.localization);
|
||||
}
|
||||
|
||||
globalSchema.plugin(mongooseHidden);
|
||||
|
||||
Globals.discriminator(globalConfig.slug, globalSchema);
|
||||
});
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ async function findOne(args) {
|
||||
|
||||
if (!doc) {
|
||||
doc = {};
|
||||
} else if (doc._id) {
|
||||
doc.id = doc._id;
|
||||
delete doc._id;
|
||||
}
|
||||
|
||||
// /////////////////////////////////////
|
||||
|
||||
@@ -41,6 +41,10 @@ async function update(args) {
|
||||
|
||||
const globalJSON = global.toJSON({ virtuals: true });
|
||||
|
||||
if (globalJSON._id) {
|
||||
delete globalJSON._id;
|
||||
}
|
||||
|
||||
let { data } = args;
|
||||
|
||||
// /////////////////////////////////////
|
||||
|
||||
@@ -107,7 +107,6 @@ module.exports = (config) => {
|
||||
if (config.paths.scss) {
|
||||
const overridePath = path.join(config.paths.configDir, config.paths.scss);
|
||||
webpackConfig.resolve.alias['payload-scss-overrides'] = overridePath;
|
||||
console.log(overridePath);
|
||||
} else {
|
||||
webpackConfig.resolve.alias['payload-scss-overrides'] = path.resolve(__dirname, '../admin/scss/overrides.scss');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user