Skip to content

Commit 3360de4

Browse files
seankmccueSean McCuessemtner
authored
feat: username and email finding tool for admin portal (#183)
* Add starchess stats to competitions page * Update alumni page to include 24-25 teams * feat: username and email lookup for admin portal --------- Co-authored-by: Sean McCue <skmccue@Seans-MacBook-Pro-3.local> Co-authored-by: Scott Semtner <sjsemtner@gmail.com>
1 parent df1497c commit 3360de4

File tree

4 files changed

+127
-10
lines changed

4 files changed

+127
-10
lines changed

package-lock.json

Lines changed: 41 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"chart.js": "^2.9.4",
1313
"cors": "^2.8.5",
1414
"express": "^4.17.1",
15+
"fuse.js": "^7.1.0",
1516
"moment": "^2.30.1",
1617
"path-browserify": "^1.0.1",
1718
"postcss-loader": "^7.3.3",

src/actions/users.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,20 @@ export const promoteUserToPrimaryAdmin = async (userId: string): Promise<void> =
146146
});
147147
});
148148
};
149+
150+
export const getIdentifiers = async (): Promise<{ identifiers: string[] }> => {
151+
const token = getToken();
152+
return new Promise((resolve, reject) => {
153+
axios
154+
.get(process.env.REACT_APP_API + '/v1/users/identifiers', {
155+
headers: { Authorization: `Bearer ${token}` },
156+
})
157+
.then((res: AxiosResponse) => {
158+
resolve(res.data as { identifiers: string[] });
159+
})
160+
.catch((error) => {
161+
message.error('Failed to fetch identifiers.');
162+
reject(error);
163+
});
164+
});
165+
};

0 commit comments

Comments
 (0)