fix => search services inside guildes and stewards

This commit is contained in:
2026-01-27 14:55:54 +03:30
parent 178e283143
commit 4b8fe4e42f
4 changed files with 67 additions and 34 deletions

View File

@@ -65,14 +65,14 @@ export const PersonalInfoSection = ({
pr={{ xs: 0, md: 3 }}
mb={2}
>
<Grid container direction="column" gap={SPACING.SMALL}>
<Grid container gap={SPACING.SMALL}>
<Grid item xs={12}>
<Typography variant="h6" gutterBottom>
اطلاعات شخصی
</Typography>
</Grid>
<Grid container xs={12}>
<Grid container xs={12} md={6} gap={SPACING.SMALL} px={SPACING.TINY}>
<Grid container xs={12} md={6} gap={SPACING.TINY} px={SPACING.TINY}>
<Grid item xs={12}>
{guild || isAdmin ? (
<TextField

View File

@@ -109,22 +109,31 @@ export const ManageGuildsRequests = ({ userType }) => {
useEffect(() => {
fetchApiData(1);
}, [dispatch, perPage]);
}, []);
const handleSubmit = async (event) => {
event.preventDefault();
dispatch(LOADING_START());
setPage(1);
try {
const response = await dispatch(
provinceGetTotalGuildsService({
search: "filter",
value: textValue,
page: 1,
page_size: perPage,
check: true,
state: "pending",
})
IS_STEWARD
? provinceGetTotalStewardsService({
search: "filter",
value: textValue,
page: 1,
page_size: perPage,
check: true,
state: "pending",
})
: provinceGetTotalGuildsService({
search: "filter",
value: textValue,
page: 1,
page_size: perPage,
check: true,
state: "pending",
})
);
setData(response.payload?.data?.results || []);
setTotalRows(response.payload?.data?.count || 0);

View File

@@ -230,19 +230,32 @@ export const ManageGuilds = ({ userType }) => {
const handleSubmit = async (e) => {
e.preventDefault();
setPage(1);
const response = await dispatch(
provinceGetTotalGuildsService({
search: "filter",
value: textValue,
page: page,
page_size: perPage,
steward: false,
active_state: activeState,
is_real_person: true,
role_key: checkPathStartsWith("province")
? selectedSubUser?.key || ""
: "",
})
IS_STEWARD
? provinceGetTotalStewardsService({
search: "filter",
value: textValue,
page: 1,
page_size: perPage,
active_state: activeState,
is_real_person: true,
role_key: checkPathStartsWith("province")
? selectedSubUser?.key || ""
: "",
})
: provinceGetTotalGuildsService({
search: "filter",
value: textValue,
page: 1,
page_size: perPage,
steward: false,
active_state: activeState,
is_real_person: true,
role_key: checkPathStartsWith("province")
? selectedSubUser?.key || ""
: "",
})
);
if (response.payload.error) {

View File

@@ -35,7 +35,7 @@ export const ProvinceLegalGuildsInProvince = ({ userType }) => {
? provinceGetTotalStewardsService({
search: "filter",
value: textValue,
page: page,
page: pageNum,
page_size: perPage,
is_real_person: false,
role_key: checkPathStartsWith("province")
@@ -122,15 +122,26 @@ export const ProvinceLegalGuildsInProvince = ({ userType }) => {
e.preventDefault();
setPage(1);
const response = await dispatch(
provinceGetTotalGuildsService({
search: "filter",
value: textValue,
page: 1,
page_size: perPage,
steward: false,
active_state: "all",
is_real_person: false,
})
IS_STEWARD
? provinceGetTotalStewardsService({
search: "filter",
value: textValue,
page: 1,
page_size: perPage,
is_real_person: false,
role_key: checkPathStartsWith("province")
? selectedSubUser?.key || ""
: "",
})
: provinceGetTotalGuildsService({
search: "filter",
value: textValue,
page: 1,
page_size: perPage,
steward: false,
active_state: "all",
is_real_person: false,
})
);
if (response.payload.error) {