Skip to content

Commit

Permalink
get full form
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Hartmann <[email protected]>
  • Loading branch information
Chartman123 committed Jun 22, 2024
1 parent 74ccab8 commit 7f6cfc4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@
'apiVersion' => 'v2(\.[1-4])?'
]
],
[
'name' => 'api#getForm',
'url' => '/api/{apiVersion}/forms/{id}',
'verb' => 'GET',
'requirements' => [
'apiVersion' => 'v3'
]
],
[
'name' => 'api#cloneForm',
'url' => '/api/{apiVersion}/form/clone/{id}',
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/ViewsMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default {

try {
const response = await request(
generateOcsUrl('apps/forms/api/v2.4/form/{id}', { id }),
generateOcsUrl('apps/forms/api/v3/forms/{id}', { id }),
)
this.$emit('update:form', OcsResponse2Data(response))
this.isLoadingForm = false
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Api/ApiV2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ public function dataGetFullForm() {
* @param array $expected
*/
public function testGetFullForm(array $expected): void {
$resp = $this->http->request('GET', "api/v2.1/form/{$this->testForms[0]['id']}");
$resp = $this->http->request('GET', "api/v3/forms/{$this->testForms[0]['id']}");
$data = $this->OcsResponse2Data($resp);

// Cannot control ids, but check general consistency.
Expand Down

0 comments on commit 7f6cfc4

Please sign in to comment.