@@ -61,8 +61,8 @@ export function MailSenderPage() {
6161 const [ params , setParams ] = useState ( { text : '' } ) ;
6262 const [ sort , setSort ] = useState ( [ 'name' , 'asc' ] ) ;
6363
64- const debouncedParams = useDebouncedValue ( params , 50 ) ;
65- const debouncedSort = useDebouncedValue ( sort , 50 ) ;
64+ const debouncedParams = useDebouncedValue ( params , 500 ) ;
65+ const debouncedSort = useDebouncedValue ( sort , 500 ) ;
6666 const query = useQuery ( debouncedParams , debouncedSort ) ;
6767 const workingGroupsQuery = useWorkingGroupsQuery ( debouncedParams , debouncedSort ) ;
6868
@@ -104,7 +104,7 @@ function MailSender({ workingGroupsData, usersData }) {
104104 const recipients = [ {
105105 label : 'Все пользователи' ,
106106 value : 'all_users' ,
107- children : workingGroups . map ( ( workingGroup ) => {
107+ children : workingGroups . filter ( ( workingGroup ) => workingGroup . type !== 'subject' ) . map ( ( workingGroup ) => {
108108 return {
109109 label : workingGroup . title ,
110110 value : workingGroup . _id ,
@@ -151,7 +151,7 @@ function MailSenderWithCouncil({ workingGroupsData, usersData, debouncedParams,
151151 return {
152152 label : workingGroup . title ,
153153 value : workingGroup . _id ,
154- children : users . filter ( ( user ) => user . workingGroup === workingGroup . title ) . map ( ( value ) => {
154+ children : users . filter ( ( user ) => user . workingGroup === workingGroup . title && workingGroup . type !== 'subject' ) . map ( ( value ) => {
155155 return {
156156 label : [ value . surname , value . name , value . patronymic ] . join ( ' ' ) ,
157157 value : value . emails ? value . emails [ 0 ] . address : '' ,
@@ -180,7 +180,7 @@ function MailSenderWithCouncil({ workingGroupsData, usersData, debouncedParams,
180180 } ;
181181
182182 recipients [ 0 ] . children . push ( child ) ;
183- const mailSubject = [ 'Council' , 'От' , formatDateAndTime ( councilData . d ) ] . join ( ' ' ) ;
183+ const mailSubject = [ t ( 'Council' ) , 'От' , formatDateAndTime ( councilData . d ) ] . join ( ' ' ) ;
184184
185185 setDefaultEmails ( emails ) ;
186186 setMailSubject ( mailSubject ) ;
@@ -233,7 +233,7 @@ function MailSenderWithErrand({ workingGroupsData, usersData, debouncedParams, d
233233 return {
234234 label : workingGroup . title ,
235235 value : workingGroup . _id ,
236- children : users . filter ( ( user ) => user . workingGroup === workingGroup . title ) . map ( ( value ) => {
236+ children : users . filter ( ( user ) => user . workingGroup === workingGroup . title && workingGroup . type !== 'subject' ) . map ( ( value ) => {
237237 return {
238238 label : [ value . surname , value . name , value . patronymic ] . join ( ' ' ) ,
239239 value : value . emails ? value . emails [ 0 ] . address : '' ,
0 commit comments