unfoldingWord-dev / d43-catalog

Lambda functions for the Door43 Catalog.
https://api.door43.org/v3/catalog
MIT License
1 stars 8 forks source link

WIP: Remove slug from toc array #59

Closed jag3773 closed 4 years ago

jag3773 commented 5 years ago

the slug in the toc array is causing a crash in the uW app as it is seeing 2 entries for the language

jag3773 commented 4 years ago

@neutrinog I'm not sure if the fix I put in for this is correct but the issue is that the uW catalog is getting an extra field that is causing the app to choke. Because of this I've got to remove the entry manually every time we do publishing 🤦‍♂

To be specific, I take this file, https://cdn.door43.org/uw/txt/2/catalog.json, prettify it with jq, and then run this vim substitution command on it:

:%s/^                  "slug": "obs",$//

Note the spaces as not every slug field needs removed, it's just ones that are nested under the toc array.

You don't have to accept this PR as is, feel free to modify as needed and deploy when you are able.

da1nerd commented 4 years ago

Ok. Finally settled down enough to look at this. I just wanted to double check that nothing would break internally because of this. It appears that nothing's actually using this key on the server. And if the app can't use it then it should be safe to remove.

jag3773 commented 4 years ago

@neutrinog We need to look at this again, the code needs fixed so that it is only remove OBS slug entries that are nested under the toc.

da1nerd commented 4 years ago

fixed!