From 611cb3b9f901e1b0a59c8ea1f77a04fd3ca10e3f Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 30 Jul 2016 13:35:19 +0200 Subject: [PATCH] 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. --- client/js/models/info.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/js/models/info.js b/client/js/models/info.js index 9533e23..ad44f58 100644 --- a/client/js/models/info.js +++ b/client/js/models/info.js @@ -1,11 +1,16 @@ '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);