Skip to content

Commit

Permalink
--Solved: 212 (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaustubhai authored Mar 20, 2021
1 parent fd5e187 commit baa419d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions app/controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,13 @@ module.exports = {

// GET OVERALL PERSONAL OVERVIEW
getPersonalOverview: async (req, res, next) => {
const userId = req.user._id
const userId = req.user.id
const personalOverview = {}
try {
personalOverview.projects = await Projects.find({ createdBy: userId }).estimatedDocumentCount()
personalOverview.events = await Events.find({ createdBy: userId }).estimatedDocumentCount()
let projects = await Projects.find({ createdBy: userId })
let events = await Events.find({ createdBy: userId })
personalOverview.projects = projects.length;
personalOverview.events = events.length;
return res.status(HttpStatus.OK).json({ personalOverview })
} catch (error) {
HANDLER.handleError(req, error)
Expand Down
2 changes: 1 addition & 1 deletion app/models/Organisation.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const orgSchema = new Schema({
if (validator.isEmpty(shortDescription)) {
throw new Error('Short description is required!')
}
if (!validator.isLength(shortDescription, { min: 10 })) {
if (!validator.isLength(shortDescription, { min: 5 })) {
throw new Error('Short description should be min 5 characters long!')
}
}
Expand Down

0 comments on commit baa419d

Please sign in to comment.