szurubooru/client/js/models/info.js
rr- 1acceb941d client: refactor linking and routing
Print all links through new uri.js component
Refactor the router to use more predictable parsing
Fix linking to entities with weird names (that contain slashes, + etc.)
2017-01-21 00:13:35 +01:00

23 lines
612 B
JavaScript

'use strict';
const api = require('../api.js');
const uri = require('../util/uri.js');
const Post = require('./post.js');
class Info {
static get() {
return api.get(uri.formatApiLink('info'))
.then(response => {
return Promise.resolve(Object.assign(
{},
response,
{
featuredPost: response.featuredPost ?
Post.fromResponse(response.featuredPost) :
undefined
}));
});
}
}
module.exports = Info;