Skip to content

Commit

Permalink
remove unnecessary ending slash (/) in endpoint URLs (#4962)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilluminate authored Jun 10, 2024
1 parent 5c8f0b3 commit 989d850
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 31 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The types of changes are:

### Fixed
- Fixed an issue where the GPP signal status was prematurely set to `ready` in some scenarios [#4957](https://github.com/ethyca/fides/pull/4957)
- Removed exteraneous `/` from the several endpoint URLs [#4962](https://github.com/ethyca/fides/pull/4962)

## [2.38.0](https://github.com/ethyca/fides/compare/2.37.0...2.38.0)

Expand Down
2 changes: 1 addition & 1 deletion clients/admin-ui/cypress/support/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const stubDatasetCrud = () => {
);

// Update
cy.intercept("PUT", "/api/v1/dataset/*", { fixture: "dataset.json" }).as(
cy.intercept("PUT", "/api/v1/dataset*", { fixture: "dataset.json" }).as(
"putDataset"
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DataSubject } from "~/types/api";
const dataSubjectsApi = baseApi.injectEndpoints({
endpoints: (build) => ({
getAllDataSubjects: build.query<DataSubject[], void>({
query: () => ({ url: `data_subject/` }),
query: () => ({ url: `data_subject` }),
providesTags: () => ["Data Subjects"],
transformResponse: (subjects: DataSubject[]) =>
subjects.sort((a, b) => a.fides_key.localeCompare(b.fides_key)),
Expand All @@ -17,7 +17,7 @@ const dataSubjectsApi = baseApi.injectEndpoints({
Partial<DataSubject> & Pick<DataSubject, "fides_key">
>({
query: (dataSubject) => ({
url: `data_subject/`,
url: `data_subject`,
params: { resource_type: "data_subject" },
method: "PUT",
body: dataSubject,
Expand All @@ -26,7 +26,7 @@ const dataSubjectsApi = baseApi.injectEndpoints({
}),
createDataSubject: build.mutation<DataSubject, DataSubject>({
query: (dataSubject) => ({
url: `data_subject/`,
url: `data_subject`,
method: "POST",
body: dataSubject,
}),
Expand Down
6 changes: 3 additions & 3 deletions clients/admin-ui/src/features/data-use/data-use.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DataUse } from "~/types/api";
const dataUseApi = baseApi.injectEndpoints({
endpoints: (build) => ({
getAllDataUses: build.query<DataUse[], void>({
query: () => ({ url: `data_use/` }),
query: () => ({ url: `data_use` }),
providesTags: () => ["Data Uses"],
transformResponse: (uses: DataUse[]) =>
uses.sort((a, b) => a.fides_key.localeCompare(b.fides_key)),
Expand All @@ -20,7 +20,7 @@ const dataUseApi = baseApi.injectEndpoints({
Partial<DataUse> & Pick<DataUse, "fides_key">
>({
query: (dataUse) => ({
url: `data_use/`,
url: `data_use`,
params: { resource_type: "data_use" },
method: "PUT",
body: dataUse,
Expand All @@ -29,7 +29,7 @@ const dataUseApi = baseApi.injectEndpoints({
}),
createDataUse: build.mutation<DataUse, DataUse>({
query: (dataUse) => ({
url: `data_use/`,
url: `data_use`,
method: "POST",
body: dataUse,
}),
Expand Down
8 changes: 4 additions & 4 deletions clients/admin-ui/src/features/dataset/dataset.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface DatasetDeleteResponse {
const datasetApi = baseApi.injectEndpoints({
endpoints: (build) => ({
getAllDatasets: build.query<Dataset[], void>({
query: () => ({ url: `dataset/` }),
query: () => ({ url: `dataset` }),
providesTags: () => ["Datasets"],
}),
getAllFilteredDatasets: build.query<
Expand All @@ -52,7 +52,7 @@ const datasetApi = baseApi.injectEndpoints({
Partial<Dataset> & Pick<Dataset, "fides_key">
>({
query: (dataset) => ({
url: `dataset/`,
url: `dataset`,
params: { resource_type: "dataset" },
method: "PUT",
body: dataset,
Expand All @@ -63,7 +63,7 @@ const datasetApi = baseApi.injectEndpoints({
// on the backend to do the validation for us
createDataset: build.mutation<Dataset, Dataset | unknown>({
query: (dataset) => ({
url: `dataset/`,
url: `dataset`,
method: "POST",
body: dataset,
}),
Expand All @@ -90,7 +90,7 @@ const datasetApi = baseApi.injectEndpoints({
}),
generateDataset: build.mutation<GenerateResponse, GenerateRequestPayload>({
query: (payload) => ({
url: `generate/`,
url: `generate`,
method: "POST",
body: payload,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export type BulkPutMessagingTemplateResponse = {
const messagingTemplatesApi = baseApi.injectEndpoints({
endpoints: (build) => ({
getMessagingTemplates: build.query<MessagingTemplate[], void>({
query: () => ({ url: `messaging/templates/` }),
query: () => ({ url: `messaging/templates` }),
providesTags: () => ["Messaging Templates"],
}),
updateMessagingTemplates: build.mutation<
BulkPutMessagingTemplateResponse,
MessagingTemplate[]
>({
query: (templates) => ({
url: `messaging/templates/`,
url: `messaging/templates`,
method: "PUT",
body: templates,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const organizationApi = baseApi.injectEndpoints({
endpoints: (build) => ({
createOrganization: build.mutation<Organization, Partial<Organization>>({
query: (body) => ({
url: `organization/`,
url: `organization`,
method: "POST",
body,
}),
Expand All @@ -18,15 +18,15 @@ const organizationApi = baseApi.injectEndpoints({
Partial<Organization> & Pick<Organization, "fides_key">,
string
>({
query: (fides_key) => ({ url: `organization/${fides_key}/` }),
query: (fides_key) => ({ url: `organization/${fides_key}` }),
providesTags: ["Organization"],
}),
updateOrganization: build.mutation<
Organization,
Partial<Organization> & Pick<Organization, "fides_key">
>({
query: ({ ...patch }) => ({
url: `organization/`,
url: `organization`,
method: "PUT",
body: patch,
}),
Expand Down
6 changes: 3 additions & 3 deletions clients/admin-ui/src/features/plus/plus.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const plusApi = baseApi.injectEndpoints({
ClassifyRequestPayload
>({
query: (body) => ({
url: `plus/classify/`,
url: `plus/classify`,
method: "POST",
body,
}),
Expand All @@ -84,7 +84,7 @@ const plusApi = baseApi.injectEndpoints({
// eslint-disable-next-line @typescript-eslint/naming-convention
const { resource_type = GenerateTypes.DATASETS, ...body } = payload;
return {
url: `plus/classify/`,
url: `plus/classify`,
method: "PUT",
params: { resource_type },
body,
Expand All @@ -108,7 +108,7 @@ const plusApi = baseApi.injectEndpoints({
urlParams.append("fides_keys", key);
});
return {
url: `plus/classify/?${urlParams.toString()}`,
url: `plus/classify?${urlParams.toString()}`,
method: "GET",
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const languageApi = baseApi.injectEndpoints({
getAllLanguages: build.query<Page_Language_, LanguageQueryParams>({
query: (params) => ({
params,
url: `/plus/languages/`,
url: `/plus/languages`,
}),
providesTags: () => ["Languages"],
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const privacyExperienceConfigApi = baseApi.injectEndpoints({
ExperienceConfigParams
>({
query: (params) => ({
url: `experience-config/`,
url: `experience-config`,
params: { ...params, show_disabled: true },
}),
providesTags: () => ["Privacy Experience Configs"],
Expand Down Expand Up @@ -124,7 +124,7 @@ const privacyExperienceConfigApi = baseApi.injectEndpoints({
>({
query: (payload) => ({
method: "POST",
url: `experience-config/`,
url: `experience-config`,
body: payload,
}),
invalidatesTags: () => ["Privacy Experience Configs", "Property"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const privacyNoticesApi = baseApi.injectEndpoints({
PrivacyNoticesParams
>({
query: (params) => ({
url: `privacy-notice/`,
url: `privacy-notice`,
params: { ...params, show_disabled: true },
}),
providesTags: () => ["Privacy Notices"],
Expand Down Expand Up @@ -103,7 +103,7 @@ const privacyNoticesApi = baseApi.injectEndpoints({
>({
query: (payload) => ({
method: "POST",
url: `privacy-notice/`,
url: `privacy-notice`,
body: payload,
}),
invalidatesTags: () => ["Privacy Notices"],
Expand Down
8 changes: 4 additions & 4 deletions clients/admin-ui/src/features/system/system.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type ConnectionConfigSecretsRequest = {
const systemApi = baseApi.injectEndpoints({
endpoints: (build) => ({
getAllSystems: build.query<SystemResponse[], void>({
query: () => ({ url: `system/` }),
query: () => ({ url: `system` }),
providesTags: () => ["System"],
transformResponse: (systems: SystemResponse[]) =>
systems.sort((a, b) => {
Expand All @@ -43,14 +43,14 @@ const systemApi = baseApi.injectEndpoints({
}),
}),
getSystemByFidesKey: build.query<SystemResponse, string>({
query: (fides_key) => ({ url: `system/${fides_key}/` }),
query: (fides_key) => ({ url: `system/${fides_key}` }),
providesTags: ["System"],
}),
// we accept 'unknown' as well since the user can paste anything in, and we rely
// on the backend to do the validation for us
createSystem: build.mutation<SystemResponse, System | unknown>({
query: (body) => ({
url: `system/`,
url: `system`,
method: "POST",
body,
}),
Expand Down Expand Up @@ -95,7 +95,7 @@ const systemApi = baseApi.injectEndpoints({
Partial<System> & Pick<System, "fides_key">
>({
query: ({ ...patch }) => ({
url: `system/`,
url: `system`,
params: { resource_type: "system" },
method: "PUT",
body: patch,
Expand Down
6 changes: 3 additions & 3 deletions clients/admin-ui/src/features/taxonomy/taxonomy.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DataCategory } from "~/types/api";
const taxonomyApi = baseApi.injectEndpoints({
endpoints: (build) => ({
getAllDataCategories: build.query<DataCategory[], void>({
query: () => ({ url: `data_category/` }),
query: () => ({ url: `data_category` }),
providesTags: () => ["Data Categories"],
transformResponse: (categories: DataCategory[]) =>
categories.sort((a, b) => a.fides_key.localeCompare(b.fides_key)),
Expand All @@ -17,7 +17,7 @@ const taxonomyApi = baseApi.injectEndpoints({
Partial<DataCategory> & Pick<DataCategory, "fides_key">
>({
query: (dataCategory) => ({
url: `data_category/`,
url: `data_category`,
params: { resource_type: "data_category" },
method: "PUT",
body: dataCategory,
Expand All @@ -27,7 +27,7 @@ const taxonomyApi = baseApi.injectEndpoints({

createDataCategory: build.mutation<DataCategory, DataCategory>({
query: (dataCategory) => ({
url: `data_category/`,
url: `data_category`,
method: "POST",
body: dataCategory,
}),
Expand Down

0 comments on commit 989d850

Please sign in to comment.