/local/v1/post?id=Signed-off-by: Maxence Lange <maxence@artificial-owl.com>

pull/626/head
Maxence Lange 2019-07-19 12:53:28 -01:00
rodzic e9a63421a7
commit b90ddcda03
2 zmienionych plików z 22 dodań i 0 usunięć

Wyświetl plik

@ -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'],

Wyświetl plik

@ -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.
*