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 @@ ...@@ -198,14 +198,14 @@
} }
} }
}, },
"/api/users/{userId}": { "/api/users/{userId}/profile": {
"get": { "get": {
"tags": [ "tags": [
"user-controller" "user-controller"
], ],
"summary": "Get user", "summary": "Get profile",
"description": "Get user information", "description": "Get user profile",
"operationId": "getUser", "operationId": "getProfile",
"parameters": [ "parameters": [
{ {
"name": "userId", "name": "userId",
...@@ -219,11 +219,11 @@ ...@@ -219,11 +219,11 @@
], ],
"responses": { "responses": {
"200": { "200": {
"description": "Successfully got user", "description": "Successfully got profile",
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserDTO" "$ref": "#/components/schemas/ProfileDTO"
} }
} }
} }
...@@ -231,32 +231,21 @@ ...@@ -231,32 +231,21 @@
} }
} }
}, },
"/api/users/{userId}/profile": { "/api/users/me": {
"get": { "get": {
"tags": [ "tags": [
"user-controller" "user-controller"
], ],
"summary": "Get profile", "summary": "Get user",
"description": "Get user profile", "description": "Get user information",
"operationId": "getProfile", "operationId": "getUser",
"parameters": [
{
"name": "userId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "Successfully got profile", "description": "Successfully got user",
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/ProfileDTO" "$ref": "#/components/schemas/UserDTO"
} }
} }
} }
......
...@@ -28,41 +28,34 @@ export class UserControllerService { ...@@ -28,41 +28,34 @@ export class UserControllerService {
}); });
} }
/** /**
* Get user * Get profile
* Get user information * Get user profile
* @returns UserDTO Successfully got user * @returns ProfileDTO Successfully got profile
* @throws ApiError * @throws ApiError
*/ */
public static getUser({ public static getProfile({
userId, userId,
}: { }: {
userId: number, userId: number,
}): CancelablePromise<UserDTO> { }): CancelablePromise<ProfileDTO> {
return __request(OpenAPI, { return __request(OpenAPI, {
method: 'GET', method: 'GET',
url: '/api/users/{userId}', url: '/api/users/{userId}/profile',
path: { path: {
'userId': userId, 'userId': userId,
}, },
}); });
} }
/** /**
* Get profile * Get user
* Get user profile * Get user information
* @returns ProfileDTO Successfully got profile * @returns UserDTO Successfully got user
* @throws ApiError * @throws ApiError
*/ */
public static getProfile({ public static getUser(): CancelablePromise<UserDTO> {
userId,
}: {
userId: number,
}): CancelablePromise<ProfileDTO> {
return __request(OpenAPI, { return __request(OpenAPI, {
method: 'GET', method: 'GET',
url: '/api/users/{userId}/profile', url: '/api/users/me',
path: {
'userId': userId,
},
}); });
} }
} }
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