2016-06-19 17:16:40 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const api = require('../api.js');
|
2017-01-20 20:51:04 +00:00
|
|
|
const uri = require('../util/uri.js');
|
2016-07-30 11:35:19 +00:00
|
|
|
const Post = require('./post.js');
|
2016-06-19 17:16:40 +00:00
|
|
|
|
|
|
|
class Info {
|
|
|
|
static get() {
|
2017-01-20 20:51:04 +00:00
|
|
|
return api.get(uri.formatApiLink('info'))
|
2016-06-19 17:16:40 +00:00
|
|
|
.then(response => {
|
2016-08-27 13:39:47 +00:00
|
|
|
return Promise.resolve(Object.assign(
|
|
|
|
{},
|
|
|
|
response,
|
|
|
|
{
|
|
|
|
featuredPost: response.featuredPost ?
|
|
|
|
Post.fromResponse(response.featuredPost) :
|
|
|
|
undefined
|
|
|
|
}));
|
2016-06-19 17:16:40 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Info;
|