mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Refactor FAQ (#14372)
* refactor(faq): fetch from API on web Also make question list more maintainable, allowing different questions across platforms * fix(tests): don't return null when function is expected Also removes the unnecessary default to web in controller * fix(tests): add new fields to expectation, add placeholders * refactor(faq): allow reordering Co-authored-by: SabreCat <sabe@habitica.com>
This commit is contained in:
@@ -22,6 +22,7 @@ function _deleteProperties (obj, keysToDelete, platform) {
|
||||
|
||||
function _deleteOtherPlatformsAnswers (faqObject, platform) {
|
||||
const faqCopy = _.cloneDeep(faqObject);
|
||||
_.remove(faqCopy.questions, question => question.exclusions.indexOf(platform) !== -1);
|
||||
const keysToDelete = _.without(['web', 'ios', 'android'], platform);
|
||||
|
||||
_deleteProperties(faqCopy.stillNeedHelp, keysToDelete, platform);
|
||||
|
||||
Reference in New Issue
Block a user