mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 03:04:36 +00:00
Squashed commit
Use managed fonts Include userentities dynamically in grocy.openapi.json for /userfields/{entity}/{objectId} endpoints (closes #1218) Fixed userfieldsform load / save (for products and recipes) handling (fixes #1302) Fixed PUT/DELETE /objects/{entity}/{objectId} when the given object id was invalid (fixes #1396) Allow arrays in HTMLPurifier (fixes #1407)
This commit is contained in:
@@ -58,6 +58,11 @@ class GenericEntityApiController extends BaseApiController
|
||||
}
|
||||
|
||||
$row = $this->getDatabase()->{$args['entity']}($args['objectId']);
|
||||
if ($row == null)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, 'Object not found', 400);
|
||||
}
|
||||
|
||||
$row->delete();
|
||||
$success = $row->isClean();
|
||||
|
||||
@@ -90,6 +95,11 @@ class GenericEntityApiController extends BaseApiController
|
||||
}
|
||||
|
||||
$row = $this->getDatabase()->{$args['entity']}($args['objectId']);
|
||||
if ($row == null)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, 'Object not found', 400);
|
||||
}
|
||||
|
||||
$row->update($requestBody);
|
||||
$success = $row->isClean();
|
||||
|
||||
|
Reference in New Issue
Block a user