Skip to content

Commit 2f210bd

Browse files
committed
Fix cycle JSON in Contentful resp
1 parent 1df05c8 commit 2f210bd

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/server/services/contentful.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,17 @@ class ApiService {
6666
*/
6767
async getAsset(id) {
6868
const res = await this.client.getAsset(id);
69-
return res;
69+
return res.stringifySafe ? JSON.parse(res.stringifySafe()) : res;
7070
}
7171

7272
/**
7373
* Gets the specified content entry.
7474
* @param {String} id Entry ID.
7575
* @return {Promise}
7676
*/
77-
getEntry(id) {
78-
return this.client.getEntry(id);
77+
async getEntry(id) {
78+
const res = await this.client.getEntry(id);
79+
return res.stringifySafe ? JSON.parse(res.stringifySafe()) : res;
7980
}
8081

8182
/**
@@ -85,16 +86,17 @@ class ApiService {
8586
*/
8687
async queryAssets(query) {
8788
const res = await this.client.getAssets(query);
88-
return res;
89+
return res.stringifySafe ? JSON.parse(res.stringifySafe()) : res;
8990
}
9091

9192
/**
9293
* Gets an array of content entries.
9394
* @param {Object} query Optional. Query for filtering / sorting of entries.
9495
* @return {Promise}
9596
*/
96-
queryEntries(query) {
97-
return this.client.getEntries(query);
97+
async queryEntries(query) {
98+
const res = await this.client.getEntries(query);
99+
return res.stringifySafe ? JSON.parse(res.stringifySafe()) : res;
98100
}
99101
}
100102

src/shared/containers/EDU/styles/tabs.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
border-radius: 9px;
4242
margin-left: 9px;
4343
padding: 0 7px;
44+
padding-top: 2px;
4445
}
4546

4647
&.selected {

0 commit comments

Comments
 (0)