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

Backend functionalities #48

Merged
merged 2 commits into from
Dec 28, 2023
Merged
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
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