manifest icon indicating copy to clipboard operation
manifest copied to clipboard

Fixed Duplicate code for issue #170

Open Osho957 opened this issue 4 months ago • 2 comments

Issue Number

#170

Description

This PR refactors the code by eliminating the duplication of the 403 Forbidden response in the OpenAPI manifest generation. A reusable utility function getForbiddenResponse has been created and moved to a separate file (common-response.utils.ts). This function is now used across multiple files where the 403 Forbidden response is required, ensuring DRY principles and improving maintainability.

Related Issues

N/A

How can it be tested?

  1. You can just run the existing unit and integration tests to ensure no breaking changes.
  2. Test the API endpoints that require a 403 Forbidden response to confirm that the response format remains consistent after refactoring.
  3. Optionally, manually invoke any API endpoints related to manifest or entity manifest to make sure it's proper.

Checklist before submitting

  • [x] I have performed a self-review of my code (no debugs, no commented code, good naming, etc.)
  • [x] This PR is wrote in a clear language and correctly labeled

Osho957 avatar Oct 02 '24 17:10 Osho957