szurubooru/client/js/models/info.js
rr- 611cb3b9f9 client/home: fix post not being bound to its model
This resulted in errors while presenting post content control - it tried
to use methods that were available only in the actual model.
2016-07-30 13:41:44 +02:00

21 lines
543 B
JavaScript

'use strict';
const api = require('../api.js');
const Post = require('./post.js');
class Info {
static get() {
return api.get('/info')
.then(response => {
if (response.featuredPost) {
response.featuredPost =
Post.fromResponse(response.featuredPost);
}
return Promise.resolve(response);
}, response => {
return Promise.reject(response.errorMessage);
});
}
}
module.exports = Info;