gotta go fast

This commit is contained in:
Quaternions 2025-04-03 20:58:17 -07:00
parent c253874ce3
commit 1b87f0a396
Signed by: Quaternions
GPG Key ID: D0DF5964F79AC131

@ -71,12 +71,10 @@ export default function ReviewButtons(props: ReviewId) {
useEffect(() => {
async function fetchData() {
try {
// Fetch user roles
const rolesResponse = await fetch("/api/session/roles");
const rolesData = parseInt(await rolesResponse.text());
// Fetch user roles
const userResponse = await fetch("/api/session/user");
const userData = await userResponse.json();
const [rolesData, userData] = await Promise.all([
fetch("/api/session/roles").then(rolesResponse => rolesResponse.text()).then(text => parseInt(text, 10)),
fetch("/api/session/user").then(userResponse => userResponse.json())
]);
setRoles(rolesData);
setUser(userData.userId);