API-v4 route added: 'api/v4/faq' fixes #11801 (#11905)

* feat(api-v4): new /faq route added

* refactor(server): change of function name in libs/content.js
This commit is contained in:
Denys Dorokhov
2020-04-14 23:14:53 +03:00
committed by GitHub
parent 551abf292c
commit 186b929e59
8 changed files with 181 additions and 10 deletions

View File

@@ -14,8 +14,13 @@ function walkContent (obj, lang) {
});
}
export function getLocalizedContent (langCode) {
const contentClone = _.cloneDeep(common.content);
walkContent(contentClone, langCode);
return `{"success": true, "data": ${JSON.stringify(contentClone)}}`;
export function localizeContentData (data, langCode) {
const dataClone = _.cloneDeep(data);
walkContent(dataClone, langCode);
return dataClone;
}
export function getLocalizedContentResponse (langCode) {
const localizedContent = localizeContentData(common.content, langCode);
return `{"success": true, "data": ${JSON.stringify(localizedContent)}}`;
}