Skip to content
Snippets Groups Projects
Unverified Commit f6e40a60 authored by Joshua Newton's avatar Joshua Newton Committed by GitHub
Browse files

[Discourse] Update schema keys to use plural form (`topic_count` -> `topics_count`) (#9778)

* Discourse: Update schema to use plural keys

(e.g. topic_count -> topics_countN)

* Revert "Discourse: Update schema to use plural keys"

This reverts commit 4073a17aaaaa253ce9ef01754ede77ba5deaa7f5.

* `discourse.service.js`: Add `Joi.alternatives` plural schema

* `discourse.service.js`: Update func to be plural-agnostic

Previously, for e.g. 'topic', the call to the `DiscourseMetricIntegrationFactory` function supplied both 'topics' and 'topic_count'. And, we now need to check for 'topics_count' as well. To cover all three string variations, why not supply only 'topic' to the function, then selectively add the 's' on a case-by-case basis.

((Note: I've preserved the old metricName variable as to minimize the diff here and make my changes clearer.))

* `discourse.tester.js`: Add second `data` case

* Address Prettier linting warnings
parent 57820b2e
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment