v3: general cleanup

This commit is contained in:
Matteo Pagliazzi
2016-04-17 01:17:22 +02:00
parent c2b8cad886
commit b271520c53
22 changed files with 213 additions and 193 deletions
+5 -4
View File
@@ -61,14 +61,15 @@ async function saveContentToDisk (language, content) {
}
/**
* @api {get} /api/v3/content Get all available content objects. Does not require authentication.
* @api {get} /api/v3/content Get all available content objects.
* @apiDescription Does not require authentication.
* @apiVersion 3.0.0
* @apiName ContentGet
* @apiGroup Content
*
* @apiParam {string} language Optional query parameter, the language code used for the items' strings. Defaulting to english
* @apiParam {string} language Query parameter, the language code used for the items' strings. Defaulting to english
*
* @apiSuccess {Object} content All the content available on Habitica
* @apiSuccess {Object} data All the content available on Habitica
*/
api.getContent = {
method: 'GET',
@@ -95,7 +96,7 @@ api.getContent = {
res.set({
'Content-Type': 'application/json',
});
res.status(200).send(content);
res.status(200).send(content); // TODO how to use res.respond here?
// save the file in background unless it's already cached or being written right now
if (cachedContentResponses[language] !== true && cacheBeingWritten[language] !== true) {