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