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

Use v2 API route for GET resources by ID #1329

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion app/models/Organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface OrganizationAction {
* into a nicer-to-use data model of RecurringSchedules.
*/
export const fetchOrganization = (id: string): Promise<Organization> =>
get(`/api/resources/${id}`).then(
get(`/api/v2/resources/${id}`).then(
({ resource }: { resource: Organization }) => {
const recurringSchedule = parseAPISchedule(resource.schedule);
return {
Expand Down
2 changes: 1 addition & 1 deletion app/pages/OrganizationEditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ class OrganizationEditPage extends React.Component<Props, State> {
}
const resourceID = params.id;
if (resourceID) {
const url = `/api/resources/${resourceID}`;
const url = `/api/v2/resources/${resourceID}`;
fetch(url)
.then((r) => r.json())
.then((data) =>
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/organization_page.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe("Organization Page", () => {
expect(r.status).to.eq(201);
});

cy.request<{ resource: Organization }>(`/api/resources/${orgId}`).then(
cy.request<{ resource: Organization }>(`/api/v2/resources/${orgId}`).then(
(res) => {
expect(res.status).to.eq(200);
expect(res.body.resource).to.include.all.keys(
Expand Down Expand Up @@ -70,7 +70,7 @@ describe("Organization Page", () => {
});

it("should render services section with multiple services", () => {
cy.request<{ resource: Organization }>(`/api/resources/${orgId}`).then(
cy.request<{ resource: Organization }>(`/api/v2/resources/${orgId}`).then(
(res) => {
expect(res.status).to.eq(200);
expect(res.body.resource).to.include.all.keys(
Expand Down Expand Up @@ -125,7 +125,7 @@ describe("Organization Page", () => {

// Intercept client's AJAX request to services endpoint and alias as "getResourceData". Pass
// the alias to #wait method below to delay test execution until the request has returned
cy.intercept("GET", `/api/resources/${orgId}`).as("getResourceData");
cy.intercept("GET", `/api/v2/resources/${orgId}`).as("getResourceData");
cy.request<{ services: Service[] }>(
"POST",
`/api/resources/${orgId}/services`,
Expand Down
Loading