Skip to content

Commit

Permalink
Remove trailing slashes from api calls and block middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
ShootingStar91 committed Aug 6, 2024
1 parent 6186d23 commit 26e0bab
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion backend/src/middlewares/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Middleware } from '../types'
export const blockWriteRequests: Middleware = (req, res, next) => {
const allowedRoutes = [
'/user/login',
'/locality-species/',
'/locality-species',
'/refreshToken',
'/user/password',
'/user/create',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/redux/localityReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ const localitiesApi = api.injectEndpoints({
}),
getLocalitySpeciesList: builder.mutation<unknown[], number[]>({
query: (lids: number[]) => ({
url: `/locality-species/`,
url: `/locality-species`,
body: { lids },
method: 'POST',
}),
}),
editLocality: builder.mutation<{ id: number }, EditDataType<LocalityDetailsType>>({
query: locality => ({
url: `/locality/`,
url: `/locality`,
method: 'PUT',
body: { locality },
}),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/redux/referenceReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const referencesApi = api.injectEndpoints({
}),
editReference: builder.mutation<ReferenceDetailsType, EditDataType<ReferenceDetailsType>>({
query: reference => ({
url: `/reference/`,
url: `/reference`,
method: 'PUT',
body: { reference },
}),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/redux/speciesReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const speciesApi = api.injectEndpoints({
}),
editSpecies: builder.mutation<SpeciesDetailsType, EditDataType<SpeciesDetailsType>>({
query: species => ({
url: `/species/`,
url: `/species`,
method: 'PUT',
body: { species },
}),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/redux/timeBoundReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const timeboundsApi = api.injectEndpoints({
}),
editTimeBound: builder.mutation<TimeBoundDetailsType, EditDataType<TimeBoundDetailsType>>({
query: timeBound => ({
url: `/time-bound/`,
url: `/time-bound`,
method: 'PUT',
body: { timeBound },
}),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/redux/timeUnitReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const timeunitsApi = api.injectEndpoints({
}),
editTimeUnit: builder.mutation<TimeUnitDetailsType, EditDataType<TimeUnitDetailsType>>({
query: timeUnit => ({
url: `/time-unit/`,
url: `/time-unit`,
method: 'PUT',
body: { timeUnit },
}),
Expand Down

0 comments on commit 26e0bab

Please sign in to comment.