Yes you can use them inside the AMD module but keep in mind once you add an event listener on the window object it will be called everytime there is an action:ajaxify.end. If you don't want it triggered after you leave that page you need to turn it off with $(window).off('eventName', myMethod)
[nodebb-plugin-write-api] Updating Post using PUT not functionning
-
Hello guys,
I'm getting an error when I try to update a Post in a Topic with the write-api plugin, using the following CURL command in a terminal :curl -X PUT --insecure -v -H "Authorization: Bearer MASTER_TOKEN" --data "pid=47&content=NewContent&_uid=1" https://xxxxxxxx.nodebb.com/api/v1/topics/23
Just in case you ask :
- the topic id 23 does exist.
- the post id 47 does exist and is in the topic 23
and I get the following :
{"code":"not-found","message":"Invalid API call","params":{}}
To verify my curl command when I try something else like updating a Category, it works.
curl -X PUT --insecure -v -H "Authorization: Bearer MASTER_TOKEN" --data "name=TestCategorie&bgColor=blue&_uid=1" https://xxxxxxxx.nodebb.com/api/v1/categories/10
I think that there's a mistake somewhere, probably in the post id, but I'm sure that the id number is good..
Do you have any other idea ?
Thank you -
v3.2.1 of the write-api fixes this issue, although executing this route will cause NodeBB to crash unless you are on core commit 098111ba5b9ef820b900bc3c6912deed0ca2f9ec or higher.
-
Hello Julian. Thank you for your very useful answer.
The plugin was an old version.
I just did uninstall then reinstall the last nodebb-api-write plugin (version 3.1.5) on our instance, but now I get the following error :
/admin/plugins/write-api Introuvable (not found)