Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
client.userLikedPosts error
Browse files Browse the repository at this point in the history
  • Loading branch information
RusAlex committed Oct 21, 2016
1 parent d78066d commit a00666a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/api/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,13 @@ export default class ApiClient

async userLikedPosts() {
const response = await this.get(`/api/v1/posts/liked`);
return await response.json();
const json = await response.json();

if (!response.ok) {
throw new Error(json.error);
}

return json;
}

async schoolPosts(schoolUrlName) {
Expand Down

0 comments on commit a00666a

Please sign in to comment.