Skip to content

Commit 5fa586a

Browse files
committed
fixup! refactor: enhance form update method with validation and permission checks
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent 5a33c6e commit 5fa586a

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

lib/Controller/ApiController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public function getForm(int $formId): DataResponse {
250250
*
251251
* @param int $formId The ID of the form to update.
252252
* @param array<string, mixed> $keyValuePairs Key-value pairs to update on the form.
253-
* @return DataResponse<Http::STATUS_OK, int|string, array<{}>>
253+
* @return DataResponse<Http::STATUS_OK, int|string, array{}>
254254
* @throws OCSBadRequestException If the new form owner cannot be found.
255255
* @throws OCSForbiddenException If the input is empty, forbidden keys are present, or the user is not allowed to modify the form.
256256
* @throws OCSNotFoundException If the form is not found.

openapi.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,44 @@
10391039
}
10401040
],
10411041
"responses": {
1042+
"200": {
1043+
"description": "Returns the ID of the updated form",
1044+
"content": {
1045+
"application/json": {
1046+
"schema": {
1047+
"type": "object",
1048+
"required": [
1049+
"ocs"
1050+
],
1051+
"properties": {
1052+
"ocs": {
1053+
"type": "object",
1054+
"required": [
1055+
"meta",
1056+
"data"
1057+
],
1058+
"properties": {
1059+
"meta": {
1060+
"$ref": "#/components/schemas/OCSMeta"
1061+
},
1062+
"data": {
1063+
"oneOf": [
1064+
{
1065+
"type": "integer",
1066+
"format": "int64"
1067+
},
1068+
{
1069+
"type": "string"
1070+
}
1071+
]
1072+
}
1073+
}
1074+
}
1075+
}
1076+
}
1077+
}
1078+
}
1079+
},
10421080
"400": {
10431081
"description": "If the new form owner cannot be found.",
10441082
"content": {

0 commit comments

Comments
 (0)