marcinadd / projecty-web

Project management software based on spring
GNU General Public License v3.0
74 stars 74 forks source link

Message Validator #51

Closed marcinadd closed 4 years ago

marcinadd commented 4 years ago
scheleon commented 4 years ago

Should I just validate the message using a simple regex expression?

marcinadd commented 4 years ago

First of all, remember to fetch all changes from branch api_mappings and you should work on this branch (I've just pushed a commit with //TODO). I hope that this branch will be merged into master as soon as possible. Anyway, to validate you should implement Validator from org.springframework.validation. Remember to check if a user with given recipientUsername exists. Message title and text should be empty too. That's my minimal requirements. If you want you can implement your own ideas.

scheleon commented 4 years ago

I just have to add a validator and pass the message through the it before sending in message service, right? Well, I'll add a custom error to be thrown if the user is not present in the list.

scheleon commented 4 years ago

Message title and text should be empty too.

I guess there's a typo. Correct me if I'm wrong! 😅

marcinadd commented 4 years ago

Ofc they shouldn't be empty. Moreover they shouldn't be blank.

I just have to add a validator and pass the message through the it before sending in message service, right?

Right

shourav9884 commented 4 years ago

@scheleon are you working on it? if no, I can.

scheleon commented 4 years ago

Sorry for keeping the issue blocked for time. And yes please go on and get it done.

shourav9884 commented 4 years ago

@marcinadd added a pull request #55 . please let me know