-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PrivateEvents #36
base: dev-v2
Are you sure you want to change the base?
PrivateEvents #36
Conversation
* updating changes * Issue #34 resolved * Added cron-job : TrendUpdate News
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor improvements in code style
src/models/user.ts
Outdated
@@ -25,8 +26,28 @@ export interface UserImpl extends Document { | |||
reminders: Object; | |||
isAdmin: boolean; | |||
isSuperAdmin: boolean; | |||
roles: mongoose.Types.ObjectId[]; | |||
permissions: UserPermImpl[]; //Local Permissions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this it is storing redundant data, Instead, make a single function that takes user roles array and return the permissions out of it.
src/controllers/event.ts
Outdated
if (event === null || user === null) { | ||
throw createError(400, 'Invalid', 'No Such Event Exists'); | ||
} | ||
if (req.body.name !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix The update method, the same can be done using a single command.
Private events implemented, Changed the interfaces EventImpl, BodyImpl and BodyMemberImpl and the corresponding schemas.
Modified getEvent and getEvents apis