Skip to content

Commit

Permalink
use PUT for updating submission
Browse files Browse the repository at this point in the history
Signed-off-by: Timotheus Pokorra <[email protected]>
  • Loading branch information
tpokorra committed Jan 9, 2025
1 parent 6ec4990 commit 556b5f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ public function newSubmission(int $formId, array $answers, string $shareHash = '
#[NoAdminRequired()]
#[NoCSRFRequired()]
#[PublicPage()]
#[ApiRoute(verb: 'POST', url: Constants::API_BASE . 'forms/{formId}/submissions/{submissionId}', requirements: Constants::API_V3_REQUIREMENTS)]
#[ApiRoute(verb: 'PUT', url: Constants::API_BASE . 'forms/{formId}/submissions/{submissionId}', requirements: Constants::API_V3_REQUIREMENTS)]
public function updateSubmission(int $formId, int $submissionId, array $answers, string $shareHash = ''): DataResponse {
$this->logger->debug('Updating submission: formId: {formId}, answers: {answers}, shareHash: {shareHash}', [
'formId' => $formId,
Expand Down
2 changes: 1 addition & 1 deletion src/views/Submit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ export default {

try {
if (this.submissionId) {
await axios.post(
await axios.put(
generateOcsUrl(
'apps/forms/api/v3/forms/{id}/submissions/{submissionId}',
{
Expand Down

0 comments on commit 556b5f2

Please sign in to comment.