docs: Update API documentation for profile routes

This commit is contained in:
tecc 2023-06-02 20:09:17 +02:00
parent 18a6f27414
commit 5aeaf8b98d
No known key found for this signature in database
GPG Key ID: 400AAD881FCC028B

View File

@ -25,7 +25,7 @@
<span v-html="note"></span>
</li>
</ul>
<p v-if="queryString" class="mb-0 small">
<p v-if="queryString" class="mt-2 mb-0 small bold">
<T>api.query</T><T>quotation.colon</T>
</p>
<ul v-if="queryString" class="small">
@ -42,6 +42,13 @@
<script>
import {head} from "../src/helpers";
function get_profile(route_part, param) {
return ['GET', `/api/profile/${route_part}/{${param}}?version=2`, {
'props': "Specify what properties that the response should include. How to specify them is described <a href='https://gitlab.com/PronounsPage/PronounsPage/-/merge_requests/345#table-of-keys'> here.",
'lprops[<locale>]': "Same as the <code>props</code> parameter, but only for specific locales. Replace <code>&lt;locale&gt;</code> with the locale you wish to override the filter for."
}, ['Note that the <code>birthday</code> field will only be available when querying your own account; otherwise only the calculated <code>age</code> might be available (if the person has filled out their birthday)']]
}
export default {
data() {
return {
@ -93,8 +100,8 @@
header: 'profile.header',
icon: 'id-card',
endpoints: {
profile_get: ['GET', '/api/profile/get/{username}?version=2', undefined, ['Note that the <code>birthday</code> field will only be available when querying your own account; otherwise only the calucaled <code>age</code> might be available (if the person has filled out their birthday)']],
profile_get_by_id: ['GET', '/api/profile/get-id/{id}?version=2', undefined, ['Note that the <code>birthday</code> field will only be available when querying your own account; otherwise only the calucaled <code>age</code> might be available (if the person has filled out their birthday)']],
profile_get: get_profile("get", "username"),
profile_get_by_id: get_profile("get-id", "id"),
user_socialLookup: ['GET', '/api/user/social-lookup/{provider}/{identifier}', undefined],
},
}, {