Sefaria / Sefaria-Project

New Interfaces for Jewish Texts
https://www.sefaria.org
654 stars 268 forks source link

fix(Category API): allow for json or body in POST #1981

Closed stevekaplan123 closed 2 months ago

stevekaplan123 commented 2 months ago

Description

Previously, the Category API assumed a 'json' parameter being passed in request.POST, but adminEditorApiRequest in sefaria.js passes a POST body instead. Therefore, the Category Editor stopped working.

Code Changes

I simply allowed for both options -- 'json' in request.POST or a body -- in case someone wants to edit the category not using the Admin Editor.