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

(refactor) Replace usages of /ws/rest/v1/ with restBaseUrl #225

Merged
merged 2 commits into from
Mar 1, 2024

Conversation

jwnasambu
Copy link
Contributor

@jwnasambu jwnasambu commented Feb 27, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

Change all instances of the hard-coded API base URL '/ws/rest/v1/' to use the restBaseUrl variable instead. To enhances maintainability and flexibility of the API base URL configuration.

Screenshots

Not available

Related Issue

https://openmrs.atlassian.net/browse/O3-2815

Other

import type { Form } from '../types';

export const useForm = (uuid: string) => {
const url = `/ws/rest/v1/form/${uuid}?v=full`;
const url = `${restBaseUrl}/${uuid}?v=full`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const url = `${restBaseUrl}/${uuid}?v=full`;
const url = `${restBaseUrl}/form/${uuid}?v=full`;

@denniskigen
Copy link
Member

denniskigen commented Feb 28, 2024

Please add a conventional commit label to your PR title.

@jwnasambu jwnasambu changed the title Replace usages of '/ws/rest/v1/' with restBaseUrl (refactor)Replace usages of '/ws/rest/v1/' with restBaseUrl Feb 28, 2024
@denniskigen denniskigen changed the title (refactor)Replace usages of '/ws/rest/v1/' with restBaseUrl (refactor) Replace usages of /ws/rest/v1/ with restBaseUrl Mar 1, 2024
@denniskigen
Copy link
Member

Thanks, @jwnasambu!

@denniskigen denniskigen merged commit 99ec207 into openmrs:main Mar 1, 2024
6 checks passed
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.

2 participants