Skip to content

Commit

Permalink
Updated the README and expected request methods
Browse files Browse the repository at this point in the history
  • Loading branch information
stevandoMoodle committed Mar 13, 2023
1 parent 3a5c7ce commit 1a521da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ http://localhost:8001/serverID/API
```

In addition to the standard endpoints, additional endpoints are provided for creating an Admin user:
Expected method is (POST)

```
/backoffice/create-admin
```

In addition, the following endpoint can be used to trigger a reset between tests:
Expected method is (POST)

```
/backoffice/reset
Expand Down
8 changes: 4 additions & 4 deletions application/src/Controller/BackOfficeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ public function backOfficeCreateAdmin(string $serverID, Request $request) : Json
'password' => 'password'
], 200);
} else {
return new JsonResponse(
'Only POST method is allowed.',
403
);
return new JsonResponse((object)[
'errcode' => 'M_UNRECOGNIZED',
'error' => 'Unrecognized request'
], 403 );
}
}

Expand Down

0 comments on commit 1a521da

Please sign in to comment.