diff --git a/api/actions/tolist.php b/api/actions/tolist.php new file mode 100644 index 0000000..8f2624d --- /dev/null +++ b/api/actions/tolist.php @@ -0,0 +1,23 @@ +get("Note does not exist", false), "ERROR"); +} + +if (!$note->hasWriteAccess(getRequestUser())) { + sendJsonResp($Strings->get("You don't have permission to edit this note.", false), "ERROR"); +} + +$note->toChecklist(); + +$note->saveNote(); + +sendJsonResp($Strings->get("Note saved", false), "OK", ["note" => $note->toArray()]); diff --git a/api/apisettings.php b/api/apisettings.php index d776a1d..985b449 100644 --- a/api/apisettings.php +++ b/api/apisettings.php @@ -46,5 +46,11 @@ $APIS = [ "id" => "/^[0-9]+$/", "favorite (optional)" => "/^[0-1]+$/" ] + ], + "tolist" => [ + "load" => "tolist.php", + "vars" => [ + "id" => "/^[0-9]+$/" + ] ] ];