mirror of
https://github.com/friendica/friendica
synced 2025-04-25 05:10:11 +00:00
API: Unified request parameter handling
This commit is contained in:
parent
57893fe24a
commit
97356ed617
4 changed files with 50 additions and 77 deletions
|
@ -78,13 +78,16 @@ class Lists extends BaseApi
|
|||
|
||||
public static function put(array $parameters = [])
|
||||
{
|
||||
$data = self::getPutData();
|
||||
$request = self::getRequest([
|
||||
'title' => '', // The title of the list to be updated.
|
||||
'replies_policy' => '', // Enumerable oneOf followed list none.
|
||||
]);
|
||||
|
||||
if (empty($data['title']) || empty($parameters['id'])) {
|
||||
if (empty($request['title']) || empty($parameters['id'])) {
|
||||
DI::mstdnError()->UnprocessableEntity();
|
||||
}
|
||||
|
||||
Group::update($parameters['id'], $data['title']);
|
||||
Group::update($parameters['id'], $request['title']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue