diff --git a/app/dashboard/components/profileHeader.tsx b/app/dashboard/components/profileHeader.tsx
index a793408..3506481 100644
--- a/app/dashboard/components/profileHeader.tsx
+++ b/app/dashboard/components/profileHeader.tsx
@@ -229,7 +229,7 @@ export default function ProfileHeader(props: {
Delayed Entry
- You will be able to check in after 10:45am on a first come
+ You will be able to check in after 10:30am on a first come
first serve basis. Please be there as soon as possible to
secure your spot.
@@ -241,7 +241,7 @@ export default function ProfileHeader(props: {
<>
You are confirmed! You are guaranteed entry if you check in
- between 9am to 10:45am. Afterwards, 10:45am will be check in
+ between 9am to 10:30am. Afterwards, 10:30am will be check in
acceptance on a first come first serve basis.
>
@@ -282,7 +282,7 @@ export default function ProfileHeader(props: {
You have indicated you are coming. If your status
changes to confirmed you are guaranteed entry
- between 9am and 10:45am. After 10:45am, check in
+ between 9am and 10:30am. After 10:30am, check in
will be first come first serve.
Status:
- {fullName &&
Scanned: {fullName}
}
+ {fullName &&
Found User: {fullName}
}
{status === 'SUCCESSFUL' && (
Successful.
@@ -147,32 +147,21 @@ function OrganizerView() {
setScannedName(userData.first_name + ' ' + userData.last_name);
if (scannerTab === 'CHECK IN') {
- if (
- userData.registration_status === 'confirmed' ||
- userData.registration_status == 'checked_in' ||
- userData.registration_status == 'coming' ||
- (now > timeWhenAllHackersCanComeThrough &&
- userData.registration_status !== 'unregistered')
- ) {
- const resp = await SetUser(
- { registration_status: 'checked_in' },
- result,
- );
-
- if (resp.error !== '') {
- setStatus('FAILED');
- setScanResponse(
- resp.error +
- ' : Registration Status: ' +
- userData.registration_status,
- );
- return;
- }
+ const resp = await SetUser({ registration_status: 'checked_in' }, result);
- setStatus('SUCCESSFUL');
- } else {
- setStatus('PENDING');
+ if (!resp) {
+ setStatus('FAILED');
+ setScanResponse('Failed to check in user.');
}
+
+ if (resp.error !== '') {
+ setStatus('FAILED');
+ setScanResponse(resp.response + '; ' + resp.error);
+ return;
+ }
+
+ setScanResponse(resp.response);
+ setStatus('SUCCESSFUL');
} else if (scannerTab === 'EVENT') {
if (selectedEvent == '') {
alert('Please select an event first!');
@@ -193,14 +182,13 @@ function OrganizerView() {
const multipleAttendanceStatus = 409;
if (resp.status == multipleAttendanceStatus && !forceAttendance) {
- console.log('HI');
setShowForceAttendance(true);
return;
}
if (resp.error !== '') {
setStatus('FAILED');
- setScanResponse(resp.error);
+ setScanResponse(resp.error + '; ' + resp.response);
return;
}
@@ -232,7 +220,7 @@ function OrganizerView() {
if (resp.error !== '') {
setStatus('FAILED');
- setScanResponse(resp.error);
+ setScanResponse(resp.error + '; ' + resp.response);
return;
}
@@ -262,7 +250,7 @@ function OrganizerView() {
if (resp.error !== '') {
setStatus('FAILED');
- setScanResponse(resp.error);
+ setScanResponse(resp.error + '; ' + resp.response);
return;
}
@@ -289,13 +277,12 @@ function OrganizerView() {
try {
const data = await getSelf();
- const domain = data.response.email.slice(-11)
- setIsSponsor(domain == "sponsor.com")
- if (domain == "sponsor.com"){
- setScannerTab("SPONSOR")
+ const domain = data.response.email.slice(-11);
+ setIsSponsor(domain == 'sponsor.com');
+ if (domain == 'sponsor.com') {
+ setScannerTab('SPONSOR');
resetScanLog();
}
-
} catch (error) {
console.log(error);
}
@@ -312,12 +299,12 @@ function OrganizerView() {
Organizer View
{/* Two buttons, semi-radio where one button is for the "tab". If active, darken the button */}
-
+
{
setScannerTab('CHECK IN');
resetScanLog();
@@ -329,7 +316,7 @@ function OrganizerView() {
disabled={isSponsor}
className={`rounded bg-blue-500 px-4 py-2 font-bold text-white hover:bg-blue-700 ${
scannerTab === 'EVENT' ? 'bg-blue-700' : ''
- }${isSponsor ? "bg-blue-500 hover:bg-blue-500": ""}`}
+ }${isSponsor ? 'bg-blue-500 hover:bg-blue-500' : ''}`}
onClick={() => {
setScannerTab('EVENT');
resetScanLog();
@@ -341,7 +328,7 @@ function OrganizerView() {
disabled={isSponsor}
className={`rounded bg-blue-500 px-4 py-2 font-bold text-white hover:bg-blue-700 ${
scannerTab === 'MANUAL' ? 'bg-blue-700' : ''
- }${isSponsor ? "bg-blue-500 hover:bg-blue-500": ""}`}
+ }${isSponsor ? 'bg-blue-500 hover:bg-blue-500' : ''}`}
onClick={() => {
setScannerTab('MANUAL');
resetScanLog();
diff --git a/app/lib/actions.ts b/app/lib/actions.ts
index 887e4ac..ecca30b 100644
--- a/app/lib/actions.ts
+++ b/app/lib/actions.ts
@@ -252,11 +252,10 @@ export async function GetUser(email: string) {
})
.then(async (res) => {
let res_json = await res.json();
- if (res.status == 200){
- resp.response = res_json
- }
- else{
- resp.error = res_json
+ if (res.status == 200) {
+ resp.response = res_json;
+ } else {
+ resp.error = res_json;
}
})
.catch((error) => {
@@ -299,9 +298,8 @@ export async function SetUser(data: any, user_email_to_update: string) {
} else {
resp.error = 'Unexpected Error';
}
- } else {
- resp.response = resJSON.message;
}
+ resp.response = resJSON.message;
})
.catch((error) => {
resp.error = error + '; An error occurred retrieving data';
@@ -654,7 +652,7 @@ export async function AttendEventScan(
if (statusCode === 404) {
error_message = `User ${scannedEmail} not found. Please try again.`;
} else if (statusCode === 409) {
- error_message = `User ${scannedEmail} is already checked in to ${event}!`;
+ error_message = json.message;
}
if (statusCode === 200 && typeof jsonBody !== 'string') {
diff --git a/app/ui/skeletons.tsx b/app/ui/skeletons.tsx
index 6f38be3..bf92a71 100644
--- a/app/ui/skeletons.tsx
+++ b/app/ui/skeletons.tsx
@@ -1,4 +1,4 @@
-import Navbar from "../(pre-dashboard)/(landing)/sections/Hero/Navbar";
+import Navbar from '../(pre-dashboard)/(landing)/sections/Hero/Navbar';
import { handleSignOut } from '@/app/lib/actions';
import { Button } from './button';
@@ -65,27 +65,28 @@ export function InvoiceSkeleton() {
export function HackerDashboardSkeleton() {
return (
-
+
+
Experiencing issues?
{
await handleSignOut();
window.location.href = '/';
}}
>
- Log Out
+ Click Here to Log Out
-
{/*
*/}
-
+
);
}