use authtoken and connection status to verify feedback

This commit is contained in:
Tainan Felipe 2018-05-10 17:23:17 -03:00
parent 63e8051a93
commit 5659ba10e7
2 changed files with 9 additions and 4 deletions

View File

@ -80,10 +80,16 @@ WebApp.connectHandlers.use('/feedback', (req, res) => {
const {
meetingId,
userId,
authToken,
} = body;
const user = Users.findOne({
meetingId,
userId,
connectionStatus: 'offline',
authToken,
});
const user = Users.findOne({ meetingId, userId });
const feedback = {
userName: user.name,
...body,

View File

@ -88,6 +88,7 @@ class MeetingEnded extends React.PureComponent {
selected: starNumber,
});
}
sendFeedback() {
const {
selected,
@ -95,7 +96,6 @@ class MeetingEnded extends React.PureComponent {
const {
router,
userName,
} = this.props;
if (selected <= 0) {
@ -106,12 +106,11 @@ class MeetingEnded extends React.PureComponent {
const message = {
rating: selected,
userId: Auth.userID,
authToken: Auth.token,
meetingId: Auth.meetingID,
comment: MeetingEnded.getComment(),
userName,
};
const url = '/html5client/feedback';
const options = {
method: 'POST',
body: JSON.stringify(message),