mirror of
https://github.com/grocy/grocy.git
synced 2025-08-19 03:40:10 +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:
@@ -36,6 +36,12 @@ class OpenApiController extends BaseApiController
|
||||
$spec->info->description = str_replace('PlaceHolderManageApiKeysUrl', $this->AppContainer->get('UrlManager')->ConstructUrl('/manageapikeys'), $spec->info->description);
|
||||
$spec->servers[0]->url = $this->AppContainer->get('UrlManager')->ConstructUrl('/api');
|
||||
|
||||
$spec->components->internalSchemas->ExposedEntity_IncludingUserEntities = clone $spec->components->internalSchemas->ExposedEntity;
|
||||
foreach ($this->getUserfieldsService()->GetEntities() as $userEntity)
|
||||
{
|
||||
array_push($spec->components->internalSchemas->ExposedEntity_IncludingUserEntities->enum, $userEntity);
|
||||
}
|
||||
|
||||
$spec->components->internalSchemas->ExposedEntity_NotIncludingNotEditable = clone $spec->components->internalSchemas->StringEnumTemplate;
|
||||
foreach ($spec->components->internalSchemas->ExposedEntity->enum as $value)
|
||||
{
|
||||
@@ -45,6 +51,15 @@ class OpenApiController extends BaseApiController
|
||||
}
|
||||
}
|
||||
|
||||
$spec->components->internalSchemas->ExposedEntity_IncludingUserEntities_NotIncludingNotEditable = clone $spec->components->internalSchemas->StringEnumTemplate;
|
||||
foreach ($spec->components->internalSchemas->ExposedEntity_IncludingUserEntities->enum as $value)
|
||||
{
|
||||
if (!in_array($value, $spec->components->internalSchemas->ExposedEntityNoEdit->enum))
|
||||
{
|
||||
array_push($spec->components->internalSchemas->ExposedEntity_IncludingUserEntities_NotIncludingNotEditable->enum, $value);
|
||||
}
|
||||
}
|
||||
|
||||
$spec->components->internalSchemas->ExposedEntity_NotIncludingNotDeletable = clone $spec->components->internalSchemas->StringEnumTemplate;
|
||||
foreach ($spec->components->internalSchemas->ExposedEntity->enum as $value)
|
||||
{
|
||||
|
Reference in New Issue
Block a user