szurubooru/client/js/models/info.js
rr- 6b042504b0 client/home: fix reporting backend errors
The code mistakenly referred to a non-existing field. Now it matches the
rest of the error handlers.
2016-08-28 20:00:50 +02:00

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;