1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Users API: Fixed sending invite when using form requests

- Cast send_invite value in cases where it might not have been a boolean,
  which occurs on non-JSON requests.
- Added test to cover.
- Updated API docs to mention and shown boolean usage.
This commit is contained in:
Dan Brown
2023-12-13 15:11:42 +00:00
parent 4896c4047f
commit 56d07f1909
3 changed files with 27 additions and 2 deletions

View File

@ -66,6 +66,12 @@
</em>
</p>
<p>
<em>
* Form requests can accept boolean (<code>true</code>/<code>false</code>) values via a <code>1</code> or <code>0</code>.
</em>
</p>
<p>
Regardless of format chosen, ensure you set a <code>Content-Type</code> header on requests so that the system can correctly parse your request data.
The API is primarily designed to be interfaced using JSON, since responses are always in JSON format, hence examples in this documentation will be shown as JSON.
@ -82,17 +88,19 @@
<pre><code class="language-json">{
"name": "My new item",
"locked": true,
"books": [105, 263],
"tags": [{"name": "Tag Name", "value": "Tag Value"}],
}</code></pre>
<p><strong>x-www-form-urlencoded</strong></p>
<pre><code class="language-text">name=My%20new%20item&books%5B0%5D=105&books%5B1%5D=263&tags%5B0%5D%5Bname%5D=Tag%20Name&tags%5B0%5D%5Bvalue%5D=Tag%20Value</code></pre>
<pre><code class="language-text">name=My%20new%20item&locked=1&books%5B0%5D=105&books%5B1%5D=263&tags%5B0%5D%5Bname%5D=Tag%20Name&tags%5B0%5D%5Bvalue%5D=Tag%20Value</code></pre>
<p><strong>x-www-form-urlencoded (Decoded for readability)</strong></p>
<pre><code class="language-text">name=My new item
locked=1
books[0]=105
books[1]=263
tags[0][name]=Tag Name