Skip to content

Commit faf652d

Browse files
show creds for customer who lastemailsent is credentials or expiring
1 parent 7dccaa0 commit faf652d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/pages/hackshack/f2fhelper/template.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,18 @@ const Student = (props) => {
4343
})
4444
.then((response) => {
4545
if (response.data.length) {
46-
response.data.forEach((item) => {
47-
if (
46+
const filteredData = response.data.filter(
47+
(item) =>
4848
item.lastEmailSent === 'credentials' ||
49-
item.lastEmailSent === 'expiring'
50-
) {
49+
item.lastEmailSent === 'expiring',
50+
);
51+
if (filteredData.length) {
52+
filteredData.forEach((item) => {
5153
getStudents(token, item.studentId);
52-
}
53-
});
54+
});
55+
} else {
56+
setError('There no active participants. Please try again later!');
57+
}
5458
}
5559
})
5660
.catch((err) => {

0 commit comments

Comments
 (0)