Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Add mentee comments feature #283

Merged
merged 5 commits into from
Jan 14, 2022

Conversation

anjula-sack
Copy link
Member

@anjula-sack anjula-sack commented Jan 12, 2022

Purpose

Goals

  • Mentors and Admins should be able to add/delete comments

Approach

  • Create CRUD enpoints
  • Create comment model, service and repository

Checklist

  • This PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.
  • I have read and understood the development best practices guidelines ( http://bit.ly/sef-best-practices )
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

@sef-bot
Copy link
Member

sef-bot commented Jan 12, 2022

This pull request has been mentioned on SEF Hive. There might be relevant details there:

https://sef.discourse.group/t/implementing-the-comments-adding-feature/377/2

Copy link
Member

@Piumal1999 Piumal1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! @anjula-sack
Added some suggestions. We'll have to validate the user's profile to prevent normal users from changing the mentee comments

src/main/java/org/sefglobal/scholarx/model/Comment.java Outdated Show resolved Hide resolved
String msg = "Error, Mentee by id: " + menteeId + " doesn't exist.";
log.error(msg);
throw new ResourceNotFoundException(msg);
} else if (optionalMentee.get().getProfile().getId() == profileId) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throw unauthorized exception if the profile doesn't belong to the assignedMentor or an admin.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

@Piumal1999 Piumal1999 Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll have to add the validation used in line 68-77

String msg = "Error, Mentee by id: " + menteeId + " doesn't exist.";
log.error(msg);
throw new ResourceNotFoundException(msg);
} else if (optionalMentee.get().getProfile().getId() == profileId) {
Copy link
Member

@Piumal1999 Piumal1999 Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll have to add the validation used in line 68-77

@anjula-sack anjula-sack marked this pull request as ready for review January 13, 2022 12:26
@sef-bot
Copy link
Member

sef-bot commented Jan 13, 2022

This pull request has been mentioned on SEF Hive. There might be relevant details there:

https://sef.discourse.group/t/implementing-the-comments-adding-feature/377/9

Copy link
Member

@Piumal1999 Piumal1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! @anjula-sack
Thanks for getting this done

@Piumal1999 Piumal1999 merged commit 60b3742 into sef-global:sx-february Jan 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add mentee comments feature
3 participants