6b042504b0
The code mistakenly referred to a non-existing field. Now it matches the rest of the error handlers.
24 lines
645 B
JavaScript
24 lines
645 B
JavaScript
'use strict';
|
|
|
|
const api = require('../api.js');
|
|
const Post = require('./post.js');
|
|
|
|
class Info {
|
|
static get() {
|
|
return api.get('/info')
|
|
.then(response => {
|
|
return Promise.resolve(Object.assign(
|
|
{},
|
|
response,
|
|
{
|
|
featuredPost: response.featuredPost ?
|
|
Post.fromResponse(response.featuredPost) :
|
|
undefined
|
|
}));
|
|
}, response => {
|
|
return Promise.reject(response.description);
|
|
});
|
|
}
|
|
}
|
|
|
|
module.exports = Info;
|