Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Devops] Add Frontend Tests, Fix Coverage, Update API Docs #714

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api-docs/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Models/AnswerDetails.md
Models/AuthToken.md
Models/CodeExecution.md
Models/DifficultyLevel.md
Models/DifficultyLevelRequestDto.md
Models/Error.md
Models/ErrorResponseObject.md
Models/ExecutionResult.md
Expand All @@ -21,6 +22,7 @@ Models/NewQuestion.md
Models/NewTag.md
Models/Profile.md
Models/QuestionDetails.md
Models/QuestionRateResponseDto.md
Models/QuestionSummary.md
Models/SuccessResponseObject.md
Models/SuccessResponseObject_data.md
Expand All @@ -39,10 +41,12 @@ Models/createAnswer_201_response.md
Models/createQuestion_201_response.md
Models/createTag_201_response.md
Models/executeCode_200_response.md
Models/getBookmarkedQuestions_200_response.md
Models/getQuestionAnswers_200_response.md
Models/getQuestionAnswers_200_response_allOf_data.md
Models/getUserFollowers_200_response.md
Models/getUserProfile_200_response.md
Models/rateQuestion_200_response.md
Models/resetPassword_request.md
Models/searchQuestions_200_response.md
Models/searchQuestions_200_response_allOf_data.md
Expand Down
54 changes: 52 additions & 2 deletions api-docs/Apis/QuestionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ All URIs are relative to *http://localhost:5173/api/v1*

| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**bookmarkQuestion**](QuestionsApi.md#bookmarkQuestion) | **POST** /questions/{questionId}/bookmark | Bookmark a question |
| [**bookmarkQuestion**](QuestionsApi.md#bookmarkQuestion) | **POST** /questions/{questionId}/bookmarks | Bookmark a question |
| [**createQuestion**](QuestionsApi.md#createQuestion) | **POST** /questions | Create a new question |
| [**deleteQuestion**](QuestionsApi.md#deleteQuestion) | **DELETE** /questions/{questionId} | Delete a question |
| [**downvoteQuestion**](QuestionsApi.md#downvoteQuestion) | **POST** /questions/{questionId}/downvote | Downvote a question |
| [**getBookmarkedQuestions**](QuestionsApi.md#getBookmarkedQuestions) | **GET** /questions/bookmarked | Get bookmarked questions |
| [**getQuestionDetails**](QuestionsApi.md#getQuestionDetails) | **GET** /questions/{questionId} | Get question details |
| [**removeQuestionBookmark**](QuestionsApi.md#removeQuestionBookmark) | **DELETE** /questions/{questionId}/bookmark | Remove bookmark from a question |
| [**rateQuestion**](QuestionsApi.md#rateQuestion) | **POST** /questions/{id}/vote-difficulty | Rate a question's level of difficulty. |
| [**removeQuestionBookmark**](QuestionsApi.md#removeQuestionBookmark) | **DELETE** /questions/{questionId}/bookmarks | Remove bookmark from a question |
| [**updateQuestion**](QuestionsApi.md#updateQuestion) | **PUT** /questions/{questionId} | Update a question |
| [**upvoteQuestion**](QuestionsApi.md#upvoteQuestion) | **POST** /questions/{questionId}/upvote | Upvote a question |

Expand Down Expand Up @@ -114,6 +116,28 @@ null (empty response body)
- **Content-Type**: Not defined
- **Accept**: application/json

<a name="getBookmarkedQuestions"></a>
# **getBookmarkedQuestions**
> getBookmarkedQuestions_200_response getBookmarkedQuestions()

Get bookmarked questions

### Parameters
This endpoint does not need any parameter.

### Return type

[**getBookmarkedQuestions_200_response**](../Models/getBookmarkedQuestions_200_response.md)

### Authorization

[bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

<a name="getQuestionDetails"></a>
# **getQuestionDetails**
> createQuestion_201_response getQuestionDetails(questionId)
Expand All @@ -139,6 +163,32 @@ No authorization required
- **Content-Type**: Not defined
- **Accept**: application/json

<a name="rateQuestion"></a>
# **rateQuestion**
> rateQuestion_200_response rateQuestion(id, DifficultyLevelRequestDto)

Rate a question&#39;s level of difficulty.

### Parameters

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | **Long**| | [default to null] |
| **DifficultyLevelRequestDto** | [**DifficultyLevelRequestDto**](../Models/DifficultyLevelRequestDto.md)| | |

### Return type

[**rateQuestion_200_response**](../Models/rateQuestion_200_response.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

<a name="removeQuestionBookmark"></a>
# **removeQuestionBookmark**
> removeQuestionBookmark(questionId)
Expand Down
3 changes: 2 additions & 1 deletion api-docs/Apis/SearchApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ All URIs are relative to *http://localhost:5173/api/v1*

<a name="searchQuestions"></a>
# **searchQuestions**
> searchQuestions_200_response searchQuestions(q, tags, difficulty, page, pageSize)
> searchQuestions_200_response searchQuestions(q, tags, difficulty, page, pageSize, sortBy)

Search questions

Expand All @@ -24,6 +24,7 @@ Search questions
| **difficulty** | [**DifficultyLevel**](../Models/.md)| Filter by difficulty level | [optional] [default to null] [enum: EASY, MEDIUM, HARD] |
| **page** | **Integer**| Page number | [optional] [default to 1] |
| **pageSize** | **Integer**| Number of items per page | [optional] [default to 20] |
| **sortBy** | **String**| Sorting type | [optional] [default to recommended] |

### Return type

Expand Down
6 changes: 3 additions & 3 deletions api-docs/Apis/TagsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Follow a tag

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **tagId** | **String**| | [default to null] |
| **tagId** | **Integer**| | [default to null] |

### Return type

Expand All @@ -70,7 +70,7 @@ Get tag details

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **tagId** | **String**| | [default to null] |
| **tagId** | **Integer**| | [default to null] |

### Return type

Expand All @@ -95,7 +95,7 @@ Unfollow a tag

|Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **tagId** | **String**| | [default to null] |
| **tagId** | **Integer**| | [default to null] |

### Return type

Expand Down
9 changes: 9 additions & 0 deletions api-docs/Models/DifficultyLevelRequestDto.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# DifficultyLevelRequestDto
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **difficulty** | **String** | | [optional] [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

2 changes: 1 addition & 1 deletion api-docs/Models/NewQuestion.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| **title** | **String** | | [default to null] |
| **content** | **String** | | [default to null] |
| **tagIds** | **List** | | [optional] [default to null] |
| **difficultyLevel** | [**DifficultyLevel**](DifficultyLevel.md) | | [default to null] |
| **difficulty** | [**DifficultyLevel**](DifficultyLevel.md) | | [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

9 changes: 7 additions & 2 deletions api-docs/Models/QuestionDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
| **tags** | [**List**](TagSummary.md) | | [default to null] |
| **likeCount** | **Integer** | | [default to null] |
| **dislikeCount** | **Integer** | | [default to null] |
| **difficulty** | [**DifficultyLevel**](DifficultyLevel.md) | | [default to null] |
| **commentCount** | **Integer** | | [default to null] |
| **viewCount** | **Integer** | | [optional] [default to null] |
| **bookmarked** | **Boolean** | | [optional] [default to null] |
| **selfVoted** | **Integer** | | [optional] [default to null] |
| **bookmarked** | **Boolean** | | [default to null] |
| **selfVoted** | **Integer** | | [default to null] |
| **selfDifficultyVote** | [**DifficultyLevel**](DifficultyLevel.md) | | [default to null] |
| **easyCount** | **Integer** | | [default to null] |
| **mediumCount** | **Integer** | | [default to null] |
| **hardCount** | **Integer** | | [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

13 changes: 13 additions & 0 deletions api-docs/Models/QuestionRateResponseDto.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# QuestionRateResponseDto
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **questionId** | **Long** | | [optional] [default to null] |
| **easyCount** | **Long** | | [optional] [default to null] |
| **mediumCount** | **Long** | | [optional] [default to null] |
| **hardCount** | **Long** | | [optional] [default to null] |
| **totalCount** | **Long** | | [optional] [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

9 changes: 5 additions & 4 deletions api-docs/Models/QuestionSummary.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
|------------ | ------------- | ------------- | -------------|
| **id** | **Integer** | | [default to null] |
| **title** | **String** | | [default to null] |
| **questionBody** | **String** | | [optional] [default to null] |
| **content** | **String** | | [optional] [default to null] |
| **author** | [**UserSummary**](UserSummary.md) | | [optional] [default to null] |
| **createdAt** | **Date** | | [default to null] |
| **difficultyLevel** | [**DifficultyLevel**](DifficultyLevel.md) | | [default to null] |
| **difficulty** | [**DifficultyLevel**](DifficultyLevel.md) | | [default to null] |
| **tags** | [**List**](TagSummary.md) | | [default to null] |
| **likeCount** | **Integer** | | [default to null] |
| **commentCount** | **Integer** | | [default to null] |
| **upvoteCount** | **Integer** | | [default to null] |
| **downvoteCount** | **Integer** | | [default to null] |
| **answerCount** | **Integer** | | [default to null] |
| **viewCount** | **Integer** | | [optional] [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
2 changes: 1 addition & 1 deletion api-docs/Models/TagDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **tagId** | **String** | | [default to null] |
| **tagId** | **Integer** | | [default to null] |
| **name** | **String** | | [default to null] |
| **tagType** | [**TagType**](TagType.md) | | [optional] [default to null] |
| **description** | **String** | | [default to null] |
Expand Down
1 change: 1 addition & 0 deletions api-docs/Models/TagSummary.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
|------------ | ------------- | ------------- | -------------|
| **id** | **String** | | [optional] [default to null] |
| **name** | **String** | | [optional] [default to null] |
| **tagType** | [**TagType**](TagType.md) | | [optional] [default to null] |
| **questionCount** | **Integer** | | [optional] [default to null] |
| **photo** | **String** | | [optional] [default to null] |

Expand Down
1 change: 1 addition & 0 deletions api-docs/Models/UserProfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
| **answerCount** | **Integer** | | [optional] [default to null] |
| **answers** | [**List**](AnswerDetails.md) | | [optional] [default to null] |
| **questions** | [**List**](QuestionSummary.md) | | [optional] [default to null] |
| **followedTags** | [**List**](TagSummary.md) | | [optional] [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

10 changes: 10 additions & 0 deletions api-docs/Models/getBookmarkedQuestions_200_response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# getBookmarkedQuestions_200_response
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **status** | **Integer** | Internal status code of the response. An HTTP 200 response with an internal 500 status code is an error response. Prioritize the inner status over the HTTP status. | [default to null] |
| **data** | [**List**](QuestionSummary.md) | | [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

10 changes: 10 additions & 0 deletions api-docs/Models/rateQuestion_200_response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# rateQuestion_200_response
## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **status** | **Integer** | Internal status code of the response. An HTTP 200 response with an internal 500 status code is an error response. Prioritize the inner status over the HTTP status. | [default to null] |
| **data** | [**QuestionRateResponseDto**](QuestionRateResponseDto.md) | | [default to null] |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

10 changes: 8 additions & 2 deletions api-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ All URIs are relative to *http://localhost:5173/api/v1*
*AuthApi* | [**verifyEmail**](Apis/AuthApi.md#verifyemail) | **POST** /auth/verify-email | Verify user's email |
| *CodeExecutionApi* | [**executeCode**](Apis/CodeExecutionApi.md#executecode) | **POST** /execute-code | Execute a code snippet |
| *FeedApi* | [**getUserFeed**](Apis/FeedApi.md#getuserfeed) | **GET** /feed | Get user feed |
| *QuestionsApi* | [**bookmarkQuestion**](Apis/QuestionsApi.md#bookmarkquestion) | **POST** /questions/{questionId}/bookmark | Bookmark a question |
| *QuestionsApi* | [**bookmarkQuestion**](Apis/QuestionsApi.md#bookmarkquestion) | **POST** /questions/{questionId}/bookmarks | Bookmark a question |
*QuestionsApi* | [**createQuestion**](Apis/QuestionsApi.md#createquestion) | **POST** /questions | Create a new question |
*QuestionsApi* | [**deleteQuestion**](Apis/QuestionsApi.md#deletequestion) | **DELETE** /questions/{questionId} | Delete a question |
*QuestionsApi* | [**downvoteQuestion**](Apis/QuestionsApi.md#downvotequestion) | **POST** /questions/{questionId}/downvote | Downvote a question |
*QuestionsApi* | [**getBookmarkedQuestions**](Apis/QuestionsApi.md#getbookmarkedquestions) | **GET** /questions/bookmarked | Get bookmarked questions |
*QuestionsApi* | [**getQuestionDetails**](Apis/QuestionsApi.md#getquestiondetails) | **GET** /questions/{questionId} | Get question details |
*QuestionsApi* | [**removeQuestionBookmark**](Apis/QuestionsApi.md#removequestionbookmark) | **DELETE** /questions/{questionId}/bookmark | Remove bookmark from a question |
*QuestionsApi* | [**rateQuestion**](Apis/QuestionsApi.md#ratequestion) | **POST** /questions/{id}/vote-difficulty | Rate a question's level of difficulty. |
*QuestionsApi* | [**removeQuestionBookmark**](Apis/QuestionsApi.md#removequestionbookmark) | **DELETE** /questions/{questionId}/bookmarks | Remove bookmark from a question |
*QuestionsApi* | [**updateQuestion**](Apis/QuestionsApi.md#updatequestion) | **PUT** /questions/{questionId} | Update a question |
*QuestionsApi* | [**upvoteQuestion**](Apis/QuestionsApi.md#upvotequestion) | **POST** /questions/{questionId}/upvote | Upvote a question |
| *SearchApi* | [**searchQuestions**](Apis/SearchApi.md#searchquestions) | **GET** /search/questions | Search questions |
Expand All @@ -51,6 +53,7 @@ All URIs are relative to *http://localhost:5173/api/v1*
- [AuthToken](./Models/AuthToken.md)
- [CodeExecution](./Models/CodeExecution.md)
- [DifficultyLevel](./Models/DifficultyLevel.md)
- [DifficultyLevelRequestDto](./Models/DifficultyLevelRequestDto.md)
- [Error](./Models/Error.md)
- [ErrorResponseObject](./Models/ErrorResponseObject.md)
- [ExecutionResult](./Models/ExecutionResult.md)
Expand All @@ -60,6 +63,7 @@ All URIs are relative to *http://localhost:5173/api/v1*
- [NewTag](./Models/NewTag.md)
- [Profile](./Models/Profile.md)
- [QuestionDetails](./Models/QuestionDetails.md)
- [QuestionRateResponseDto](./Models/QuestionRateResponseDto.md)
- [QuestionSummary](./Models/QuestionSummary.md)
- [SuccessResponseObject](./Models/SuccessResponseObject.md)
- [SuccessResponseObject_data](./Models/SuccessResponseObject_data.md)
Expand All @@ -78,10 +82,12 @@ All URIs are relative to *http://localhost:5173/api/v1*
- [createQuestion_201_response](./Models/createQuestion_201_response.md)
- [createTag_201_response](./Models/createTag_201_response.md)
- [executeCode_200_response](./Models/executeCode_200_response.md)
- [getBookmarkedQuestions_200_response](./Models/getBookmarkedQuestions_200_response.md)
- [getQuestionAnswers_200_response](./Models/getQuestionAnswers_200_response.md)
- [getQuestionAnswers_200_response_allOf_data](./Models/getQuestionAnswers_200_response_allOf_data.md)
- [getUserFollowers_200_response](./Models/getUserFollowers_200_response.md)
- [getUserProfile_200_response](./Models/getUserProfile_200_response.md)
- [rateQuestion_200_response](./Models/rateQuestion_200_response.md)
- [resetPassword_request](./Models/resetPassword_request.md)
- [searchQuestions_200_response](./Models/searchQuestions_200_response.md)
- [searchQuestions_200_response_allOf_data](./Models/searchQuestions_200_response_allOf_data.md)
Expand Down
Loading
Loading