superdesk / superdesk-client-core

Common client modules for superdesk apps.
GNU Affero General Public License v3.0
32 stars 87 forks source link

Add new 'getCustomVacabulary' function in superdesk-api [SDESK-7268] #4541

Closed devketanpro closed 3 months ago

devketanpro commented 3 months ago

Add new getCustomVacabulary func in superdesk-api which we used in supedesk-analytics. https://github.com/superdesk/superdesk-analytics/pull/151

tomaskikutis commented 3 months ago

Do we have a clear definition of what exactly is a "custom" vocabulary? I'd rather expose a method to get all vocabularies from here

devketanpro commented 3 months ago

yep, custom vocabularies means which vocab we can add via metadata settings. In the backend we fetch this type of vocab by query :- "field_type": None, "service": {"$exists": True}

tomaskikutis commented 3 months ago

Since I was looking at vocabulary code I also pushed some improvements.

Regarding your code, one improvement I made is to keep API slimmer is to only expose isCustomVocabulary method. I also exposed a method to get all vocabularies so you can later filter them using isCustomVocabulary.

Let me know if you have other improvements in mind.