Skip to content

Commit

Permalink
add id:false to claustro
Browse files Browse the repository at this point in the history
  • Loading branch information
xtian7489 committed May 8, 2024
1 parent aac5167 commit e855ae8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/lib/site/home-catalogo/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class HomePropuestas extends Component {
const [facultades, tags, forum, claustrosall, textsDict] = results
const tagsMap = tags.map(tag => { return {value: tag.id, name: tag.name}; });
const tag = this.props.location.query.tags ? [tagsMap.find(j => j.name == this.props.location.query.tags).value] : [];
const claustros = claustrosall.map(claustro => { return { value: claustro.id, name: claustro.nombre }; });
const claustros = claustrosall.map(claustro => { return { value: claustro._id, name: claustro.nombre }; });
this.setState({
facultades: facultades.map(facultad => { return {value: facultad._id, name: facultad.nombre}; }),
tags: tagsMap,
Expand Down
2 changes: 1 addition & 1 deletion lib/models/claustro.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const Schema = mongoose.Schema

const ClaustroSchema = new Schema({
nombre: { type: String, required: true, minlength: 1, maxlength: 200 }
})
}, { id: false })
// esto último hace que no esté el campo _id e id duplicado

ClaustroSchema.statics.findByName = function (name, cb) {
Expand Down

0 comments on commit e855ae8

Please sign in to comment.