Skip to content
Snippets Groups Projects
Commit 7f9fab88 authored by Henrik's avatar Henrik
Browse files

feat: add me endpoint

parent 4316114c
No related branches found
No related tags found
No related merge requests found
Pipeline #275316 failed
......@@ -198,14 +198,14 @@
}
}
},
"/api/users/{userId}": {
"/api/users/{userId}/profile": {
"get": {
"tags": [
"user-controller"
],
"summary": "Get user",
"description": "Get user information",
"operationId": "getUser",
"summary": "Get profile",
"description": "Get user profile",
"operationId": "getProfile",
"parameters": [
{
"name": "userId",
......@@ -219,11 +219,11 @@
],
"responses": {
"200": {
"description": "Successfully got user",
"description": "Successfully got profile",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserDTO"
"$ref": "#/components/schemas/ProfileDTO"
}
}
}
......@@ -231,32 +231,21 @@
}
}
},
"/api/users/{userId}/profile": {
"/api/users/me": {
"get": {
"tags": [
"user-controller"
],
"summary": "Get profile",
"description": "Get user profile",
"operationId": "getProfile",
"parameters": [
{
"name": "userId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"summary": "Get user",
"description": "Get user information",
"operationId": "getUser",
"responses": {
"200": {
"description": "Successfully got profile",
"description": "Successfully got user",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProfileDTO"
"$ref": "#/components/schemas/UserDTO"
}
}
}
......
......@@ -28,41 +28,34 @@ export class UserControllerService {
});
}
/**
* Get user
* Get user information
* @returns UserDTO Successfully got user
* Get profile
* Get user profile
* @returns ProfileDTO Successfully got profile
* @throws ApiError
*/
public static getUser({
public static getProfile({
userId,
}: {
userId: number,
}): CancelablePromise<UserDTO> {
}): CancelablePromise<ProfileDTO> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/users/{userId}',
url: '/api/users/{userId}/profile',
path: {
'userId': userId,
},
});
}
/**
* Get profile
* Get user profile
* @returns ProfileDTO Successfully got profile
* Get user
* Get user information
* @returns UserDTO Successfully got user
* @throws ApiError
*/
public static getProfile({
userId,
}: {
userId: number,
}): CancelablePromise<ProfileDTO> {
public static getUser(): CancelablePromise<UserDTO> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/users/{userId}/profile',
path: {
'userId': userId,
},
url: '/api/users/me',
});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment