Skip to content
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

Added quest reject route and intial tests #6640

Conversation

TheHollidayInn
Copy link
Contributor

This is the initial quest reject code for #6509 .

  • I am unsure how we are going to track members, so I left a comment
  • @crookedneighbor is working on the questStart method, so I left that commented
  • And, I had to use update methods on the Api classes, since the quest invite route is unfinished

@@ -18,6 +18,7 @@ import * as firebase from '../../libs/api-v3/firebase';
import { sendTxn as sendTxnEmail } from '../../libs/api-v3/email';
import { encrypt } from '../../libs/api-v3/encryption';
import { quests as questScrolls } from '../../../../common/script/content';
import { mockAnalyticsService } from '../../libs/api-v3/analyticsService';
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we importing a mockAnalyticsService?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That comments said to use this in a non production environment. I was thinking that that this was replaced somehow in production. Maybe I just misread that.

@TheHollidayInn
Copy link
Contributor Author

Okay, updated! And, I fixed the merge conflict. Just waiting on Travis, as usual.

@paglias
Copy link
Contributor

paglias commented Feb 3, 2016

Looks good 👍 Waiting for startQuest

*
* @apiSuccess {Object} Quest Object
*/
api.inviteToQuest = {
Copy link
Contributor

Choose a reason for hiding this comment

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

This route was moved to a separate quests.js file. You should remove these lines and add your reject route to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesome, can do.

@crookedneighbor
Copy link
Contributor

Aside from my two remaining comments, I think this looks good.


let group = await Group.getGroup({user, groupId: req.params.groupId, fields: 'type quest'});
if (!group) throw new NotFound(res.t('groupNotFound'));
if (!quest) throw new NotFound(res.t('questNotFound', { key: questKey }));
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it already validated in the invite route?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I was thinking there was some added security with this, but I don't really see that being the case. I think it is good to remove. Sound good to you?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. Please remove it. If the party quest object is being modified with an invalid key, we have bigger problems and I'd prefer it to blow up so we can track it down.

@TheHollidayInn
Copy link
Contributor Author

Updated!

group.markModified('quest.members');

user.party.quest.RSVPNeeded = false;
user.party.quest.key = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

question: here we should use Group.cleanQuestProgress?

@paglias
Copy link
Contributor

paglias commented Feb 11, 2016

Merging manually

@paglias paglias mentioned this pull request Feb 11, 2016
@paglias
Copy link
Contributor

paglias commented Feb 11, 2016

updated version at #6693

@paglias paglias closed this Feb 11, 2016
@TheHollidayInn TheHollidayInn deleted the api-v3-quests-reject branch April 16, 2018 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants