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

feat(api): Added feedback form module #210

Merged
merged 7 commits into from
May 12, 2024

Conversation

rayaanoidPrime
Copy link
Contributor

Description

  • Created a module named feedback
  • Added a controller and a service class in it.
  • Added a function called registerFeedback(feedback: string) in the service class
  • Added a POST mapping in the feedback controller. The controller is mapped under /api/feedback
  • Marked the controller function as @public()
  • Validating that the feedback isn't null in the service class. Emailing admin@keyshade.xyz the feedback message using MailService
  • Added relevant tests for this in feedback.e2e.spec.ts

Fixes #205

Dependencies

None

Future Improvements

None

Mentions

None

Screenshots of relevant screens

None

Developer's checklist

  • My PR follows the style guidelines of this project
  • I have performed a self-check on my work

If changes are made in the code:

  • I have followed the coding guidelines
  • My changes in code generate no new warnings
  • [] My changes are breaking another fix/feature of the project
  • I have added test cases to show that my feature works
  • I have added relevant screenshots in my PR
  • There are no UI/UX issues

Documentation Update

  • This PR requires an update to the documentation at docs.keyshade.xyz
  • I have made the necessary updates to the documentation, or no documentation changes are required.

Copy link
Contributor

Failed to generate code suggestions for PR

@rajdip-b rajdip-b changed the title feat(Api): Added Feedback Form Controller and Feedback Service feat(api): Added Feedback Form Controller and Feedback Service May 12, 2024
@rajdip-b rajdip-b changed the title feat(api): Added Feedback Form Controller and Feedback Service feat(api): Added feedback form module May 12, 2024
apps/api/src/feedback/feedback.e2e.spec.ts Show resolved Hide resolved
apps/api/src/feedback/feedback.e2e.spec.ts Outdated Show resolved Hide resolved
apps/api/src/feedback/service/feedback.service.ts Outdated Show resolved Hide resolved
apps/api/src/feedback/service/feedback.service.ts Outdated Show resolved Hide resolved
@rajdip-b
Copy link
Member

/review

Copy link
Contributor

PR Review 🔍

⏱️ Estimated effort to review [1-5]

2, because the PR is well-structured with clear separation of concerns, includes tests, and follows the project's coding guidelines. However, the changes are localized to a new module, making it easier to review.

🧪 Relevant tests

Yes

⚡ Possible issues

Possible Bug: The feedback registration does not handle cases where the feedback string might be only whitespace. This could lead to unintended behavior where seemingly empty feedback is accepted.

🔒 Security concerns

No

Code feedback:
relevant fileapps/api/src/feedback/service/feedback.service.ts
suggestion      

Consider trimming the feedback string before checking if it is empty to handle cases where the feedback consists only of whitespace. This can prevent accepting empty-like strings which are technically not null. [important]

relevant lineif (!feedback) {

relevant fileapps/api/src/feedback/controller/feedback.controller.ts
suggestion      

Add HTTP status code 201 for successful feedback registration to align with RESTful practices for resource creation. Modify the registerFeedback method to return { statusCode: 201 }. [medium]

relevant lineasync registerFeedback(@Body('feedback') feedback: string): Promise {

@rajdip-b
Copy link
Member

Can you just get this resoved? https://sonarcloud.io/project/issues?resolved=false&sinceLeakPeriod=true&pullRequest=210&id=keyshade-xyz_keyshade&open=AY9tnJtdrNHifkb_0SR1

Copy link

sonarcloud bot commented May 12, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@rajdip-b rajdip-b merged commit ae1efd8 into keyshade-xyz:develop May 12, 2024
5 checks passed
@rayaanoidPrime rayaanoidPrime deleted the 205-feedback-controller branch May 13, 2024 04:41
rajdip-b pushed a commit that referenced this pull request May 24, 2024
## [1.4.0](v1.3.0...v1.4.0) (2024-05-24)

### 🚀 Features

* add example for health and email auth ([b834d25](b834d25))
* **api:** Add `minio-client` provider ([#237](#237)) ([cd71c5a](cd71c5a))
* **api:** Add feature to fork projects ([#239](#239)) ([3bab653](3bab653))
* **api:** Added feedback form module ([#210](#210)) ([ae1efd8](ae1efd8))
* **api:** Added Project Level Access  ([#221](#221)) ([564f5ed](564f5ed))
* **api:** Added support for changing email of users ([#233](#233)) ([5ea9a10](5ea9a10))
* implemented auth, ui for most, and fixed cors ([#217](#217)) ([feace86](feace86))
* **platfrom:** add delete method in api client ([#225](#225)) ([55cf09f](55cf09f))
* **postman:** add example for get_self and update_self ([e015acf](e015acf))
* **web:** Add and link privacy and tnc page ([#226](#226)) ([ec81eb9](ec81eb9))

### 🐛 Bug Fixes

* **web:** docker next config not found ([#228](#228)) ([afe3160](afe3160))

### 📚 Documentation

* Added docs regarding postman, and refactored architecture diagrams ([f1c9777](f1c9777))
* Fix typo in organization-of-code.md ([#234](#234)) ([11244a2](11244a2))

### 🔧 Miscellaneous Chores

* **api:** Get feedback forward email from process.env ([#236](#236)) ([204c9d1](204c9d1))
* **postman:** Initialized postman ([bb76384](bb76384))
* **release:** Update changelog config ([af91283](af91283))
* Remove swagger docs ([#220](#220)) ([7640299](7640299))

### 🔨 Code Refactoring

* **api:** Replaced OTP code from alphanumeric to numeric ([#230](#230)) ([f16162a](f16162a))
@rajdip-b
Copy link
Member

🎉 This PR is included in version 1.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API: Add feedback form controller
2 participants