Skip to content

Commit

Permalink
fixed admin search (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostOf0days authored Mar 16, 2024
1 parent d5cad32 commit 905fe18
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 18 deletions.
24 changes: 17 additions & 7 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# don't ever lint node_modules
node_modules
# don't lint build output (make sure it's set to your correct build folder name)
dist
# don't lint nyc coverage output
coverage
public
# .eslintignore
*.json
*.rc
*.config.ts
*.node.json
.eslint*
.prettier*
.vscode/*
.settings.json
.gitignore
.gitattributes
/coverage
/public
/node_modules
/build
/dist
/tests
31 changes: 25 additions & 6 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
{
"tabWidth": 2,
"semi": false,
"singleQuote": false,
"endOfLine": "lf",
"bracketSpacing": true,
"printWidth": 80,
"proseWrap": "preserve",
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"tabWidth": 4,
"useTabs": true,
"arrowParens": "always",
"trailingComma": "none"
}
"endOfLine": "lf",
"overrides": [
{
"files": "*.json",
"options": {
"singleQuote": false
}
},
{
"files": ".*rc",
"options": {
"singleQuote": false,
"parser": "json"
}
}
]
}
8 changes: 3 additions & 5 deletions src/components/admin/ParticipantTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ const ParticipantTable = (): ReactElement => {
<TableContainer>
<TextField
variant="outlined"
placeholder="Search"
placeholder="Search by email or status"
fullWidth={true}
value={searchString}
InputProps={{
Expand Down Expand Up @@ -498,13 +498,11 @@ const ParticipantTable = (): ReactElement => {
.trim()
.toLowerCase()
.includes(searchString.trim().toLowerCase()) ||
// Search for Applied status
// Search for applied status
(row.original.status.includes("COMPLETED_PROFILE") &&
searchString.trim().toLowerCase() == "applied") ||
// Search for admins
(!row.original.status.includes(
searchString.trim().toLowerCase()
) &&
(row.original.admin &&
searchString.trim().toLowerCase() == "admin")
)
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
Expand Down

0 comments on commit 905fe18

Please sign in to comment.