refactor(server): user info endpoint (#9668)

* refactor(server): user info endpoint

* chore: open api
This commit is contained in:
Jason Rasmussen
2024-05-22 14:15:33 -04:00
committed by GitHub
parent 202745f14b
commit ecd018a826
6 changed files with 64 additions and 66 deletions

View File

@@ -6229,48 +6229,6 @@
]
}
},
"/users/info/{id}": {
"get": {
"operationId": "getUserById",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"User"
]
}
},
"/users/me": {
"get": {
"operationId": "getMyUserInfo",
@@ -6462,6 +6420,46 @@
"tags": [
"User"
]
},
"get": {
"operationId": "getUserById",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"User"
]
}
},
"/users/{id}/restore": {

View File

@@ -2750,16 +2750,6 @@ export function updateUser({ updateUserDto }: {
body: updateUserDto
})));
}
export function getUserById({ id }: {
id: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: UserResponseDto;
}>(`/users/info/${encodeURIComponent(id)}`, {
...opts
}));
}
export function getMyUserInfo(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
@@ -2809,6 +2799,16 @@ export function deleteUser({ id, deleteUserDto }: {
body: deleteUserDto
})));
}
export function getUserById({ id }: {
id: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: UserResponseDto;
}>(`/users/${encodeURIComponent(id)}`, {
...opts
}));
}
export function restoreUser({ id }: {
id: string;
}, opts?: Oazapfts.RequestOpts) {