Skip to content

Commit

Permalink
Merge pull request #32 from CMP26Projects/hotfix-restfulapi-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedHamed3699 authored Dec 26, 2023
2 parents a72b474 + c7f230d commit 01a8baf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
18 changes: 9 additions & 9 deletions client/src/components/common/InfoSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function InfoSection() {
const { data: absenceRate, isFetching: isFetchingAbsence } =
useGetAbsenceRateQuery();

const { data: scoutsCount, isFetching: isFetchingScoutsCount } =
const { data: scouts, isFetching: isFetchingScoutsCount } =
useGetAllScoutsCountQuery();

const { data: budget, isFetching: isFetchingBudget } = useGetBudgetQuery();
Expand Down Expand Up @@ -51,9 +51,9 @@ export default function InfoSection() {
value={
isFetchingScoutsCount
? "جاري التحميل"
: !scoutsCount
: !scouts
? "لا يوجد بيانات"
: scoutsCount?.body
: scouts?.body?.length
}
color="dark"
/>
Expand All @@ -77,7 +77,7 @@ export default function InfoSection() {
const { data: absenceRate, isFetching: isFetchingAbsence } =
useGetAbsenceRateQuery();

const { data: scoutsCount, isFetching: isFetchingScoutsCount } =
const { data: scouts, isFetching: isFetchingScoutsCount } =
useGetAllScoutsCountQuery();

return (
Expand All @@ -98,9 +98,9 @@ export default function InfoSection() {
value={
isFetchingScoutsCount
? "جاري التحميل"
: !scoutsCount
: !scouts
? "لا يوجد بيانات"
: scoutsCount?.body
: scouts?.body?.length
}
color="dark"
/>
Expand All @@ -116,7 +116,7 @@ export default function InfoSection() {
const { data: absenceRate, isFetching: isFetchingAbsence } =
useGetAbsenceRateQuery();

const { data: scoutsCount, isFetching: isFetchingScoutsCount } =
const { data: scouts, isFetching: isFetchingScoutsCount } =
useGetAllScoutsCountQuery();

return (
Expand Down Expand Up @@ -149,9 +149,9 @@ export default function InfoSection() {
value={
isFetchingScoutsCount
? "جاري التحميل"
: !scoutsCount
: !scouts
? "لا يوجد بيانات"
: scoutsCount?.body
: scouts?.body?.length
}
color="dark"
/>
Expand Down
3 changes: 1 addition & 2 deletions client/src/redux/slices/captainsApiSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ export const captainsApi = apiSlice.injectEndpoints({
endpoints: (builder) => ({
GetCaptains: builder.query({
query: () => ({
url: `${CAPTAINS_URL}/allCaptains/info`,
url: `${CAPTAINS_URL}/`,
method: "GET",
}),
}),

}),
});

Expand Down
2 changes: 1 addition & 1 deletion client/src/redux/slices/financeApiSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const financeApi = apiSlice.injectEndpoints({
endpoints: (builder) => ({
GetBudget: builder.query({
query: () => ({
url: `${FINANCE_URL}/budget`,
url: `${FINANCE_URL}`,
method: "GET",
}),
}),
Expand Down
2 changes: 1 addition & 1 deletion client/src/redux/slices/scoutApiSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const scoutsApi = apiSlice.injectEndpoints({
endpoints: (builder) => ({
GetAllScoutsCount: builder.query({
query: () => ({
url: `${SCOUT_URL}/allScouts/count`,
url: `${SCOUT_URL}/`,
method: "GET",
}),
}),
Expand Down

0 comments on commit 01a8baf

Please sign in to comment.