Skip to content

Commit

Permalink
get shared challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
dlopezalvas committed Nov 27, 2023
1 parent 2e214f2 commit 8b2ceac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/api/routes/creatorChallenges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ router.post('/share', tryy(tokenAuth), onlyIfAuth, syncHandler(async (req: Authe
const { user, body } = req
body.user = user
const result = await CreatorChallengeModel.create({...body})
res.json(result)
}))

router.get('/sharedChallenge/:_id', (async (req: AuthenticatedRequest, res) => {
const { _id } = req.params as any
const challenge = await CreatorChallengeModel.findOne({ _id }).exec()
res.json(challenge)
}))


Expand Down

0 comments on commit 8b2ceac

Please sign in to comment.