-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a way to surface rules of engagement for a hunt and require hunters to agree to them before interacting with the hunt.
- Loading branch information
Showing
8 changed files
with
136 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import TypedMethod from "./TypedMethod"; | ||
|
||
export default new TypedMethod<{ huntId: string }, void>( | ||
"Users.methods.acceptHuntTerms", | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { check } from "meteor/check"; | ||
import MeteorUsers from "../../lib/models/MeteorUsers"; | ||
import acceptUserHuntTerms from "../../methods/acceptUserHuntTerms"; | ||
import defineMethod from "./defineMethod"; | ||
|
||
defineMethod(acceptUserHuntTerms, { | ||
validate(arg) { | ||
check(arg, { huntId: String }); | ||
|
||
return arg; | ||
}, | ||
|
||
async run({ huntId }) { | ||
check(this.userId, String); | ||
await MeteorUsers.updateAsync(this.userId, { | ||
$set: { [`huntTermsAcceptedAt.${huntId}`]: new Date() }, | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import "./acceptUserHuntTerms"; | ||
import "./addHuntUser"; | ||
import "./addPuzzleAnswer"; | ||
import "./addPuzzleTag"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters