mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
add getDic
This commit is contained in:
parent
de051ceebc
commit
a4eda59189
3 changed files with 10 additions and 0 deletions
|
@ -20,6 +20,7 @@ server.use bodyParser.json(limit: "2mb")
|
|||
server.use metrics.http.monitor(logger)
|
||||
|
||||
server.del "/user/:user_id", SpellingAPIController.deleteDic
|
||||
server.get "/user/:user_id", SpellingAPIController.getDic
|
||||
server.post "/user/:user_id/check", SpellingAPIController.check
|
||||
server.post "/user/:user_id/learn", SpellingAPIController.learn
|
||||
server.get "/status", (req, res)->
|
||||
|
|
|
@ -27,3 +27,9 @@ module.exports = SpellingAPIController =
|
|||
return next(error) if error?
|
||||
res.sendStatus(204)
|
||||
|
||||
|
||||
getDic: (req, res, next)->
|
||||
logger.info token: req?.params?.user_id, "getting user dictionary"
|
||||
SpellingAPIManager.getDic req.params.user_id, (error, words)->
|
||||
return next(error) if error?
|
||||
res.send(words)
|
|
@ -49,3 +49,6 @@ module.exports = SpellingAPIManager =
|
|||
deleteDic: (token, callback)->
|
||||
LearnedWordsManager.deleteUsersLearnedWords token, callback
|
||||
|
||||
getDic: (token, callback)->
|
||||
LearnedWordsManager.getLearnedWords token, callback
|
||||
|
||||
|
|
Loading…
Reference in a new issue