kopia lustrzana https://github.com/nextcloud/social
/local/v1/post?id=Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
rodzic
e9a63421a7
commit
b90ddcda03
|
@ -70,6 +70,8 @@ return [
|
|||
['name' => 'Local#streamDirect', 'url' => '/api/v1/stream/direct', 'verb' => 'GET'],
|
||||
['name' => 'Local#streamAccount', 'url' => '/api/v1/account/{username}/stream', 'verb' => 'GET'],
|
||||
|
||||
['name' => 'Local#postData', 'url' => '/local/v1/post', 'verb' => 'GET'],
|
||||
|
||||
['name' => 'Local#postCreate', 'url' => '/api/v1/post', 'verb' => 'POST'],
|
||||
['name' => 'Local#postDelete', 'url' => '/api/v1/post', 'verb' => 'DELETE'],
|
||||
|
||||
|
|
|
@ -182,6 +182,26 @@ class LocalController extends Controller {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* get info about a post (limited to viewer rights).
|
||||
*
|
||||
* @NoAdminRequired
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return DataResponse
|
||||
*/
|
||||
public function postData(string $id): DataResponse {
|
||||
try {
|
||||
$this->initViewer(true);
|
||||
|
||||
return $this->directSuccess($this->noteService->getNoteById($id, true));
|
||||
} catch (Exception $e) {
|
||||
return $this->fail($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete your own post.
|
||||
*
|
||||
|
|
Ładowanie…
Reference in New Issue