Skip to content

Commit

Permalink
Merge pull request #48 from CMP26Projects/backend-functionalities
Browse files Browse the repository at this point in the history
Backend functionalities
  • Loading branch information
amir-kedis authored Dec 28, 2023
2 parents 83bc79a + a2327a0 commit 174fabb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion client/src/redux/slices/scoutApiSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ export const scoutsApi = apiSlice.injectEndpoints({
}),
GetScoutsInSector: builder.query({
query: (sector) => ({
url: `${SCOUT_URL}/sector/${sector.baseName}/${sector.suffixName}`,
url: `${SCOUT_URL}/sector/all`,
method: "GET",
params: sector,
}),
providesTags: ["Scouts"],
}),
Expand Down
4 changes: 2 additions & 2 deletions client/src/redux/slices/sectorApiSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const captainsApi = apiSlice.injectEndpoints({
url: `${SECTOR_URL}/unit`,
method: "PATCH",
body: sector,
query: sector,
params: sector,
}),
invalidatesTags: ["Sector"],
}),
Expand All @@ -33,7 +33,7 @@ export const captainsApi = apiSlice.injectEndpoints({
url: `${SECTOR_URL}/captain/assign`,
method: "PATCH",
body: sector,
query: sector,
params: sector,
}),
invalidatesTags: ["Sector"],
}),
Expand Down
6 changes: 3 additions & 3 deletions server/controllers/sector.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ const sectorController = {
// @access Private
setUnitCaptain: async (req, res) => {
try {
const { baseName, suffixName } = req.query
const { unitCaptainId } = req.body
const { baseName, suffixName } = req.query;
const { unitCaptainId } = req.body;

if (!unitCaptainId) {
res.status(400).json({
return res.status(400).json({
error: 'Please enter valid ids',
})
}
Expand Down

0 comments on commit 174fabb

Please sign in to comment.