From a46a413b4908c0fdfbfe01193202143763328c98 Mon Sep 17 00:00:00 2001 From: avsomers25 Date: Fri, 19 Jan 2024 15:24:44 -0500 Subject: [PATCH] getUsers in data.ts mock --- app/dashboard/page.tsx | 3 +- app/lib/data.ts | 106 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 1 deletion(-) diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx index a3e2099..d25eb29 100644 --- a/app/dashboard/page.tsx +++ b/app/dashboard/page.tsx @@ -2,7 +2,7 @@ import AcmeLogo from '@/app/ui/acme-logo'; import LoginForm from '@/app/ui/login-form'; -import { getSelf } from '@/app/lib/data'; +import { getSelf, getUsers } from '@/app/lib/data'; import { useState, useEffect } from 'react'; import { AvatarImage, AvatarInitials, Avatar } from "@/app/dashboard/components/avatar" import { CardTitle, CardDescription, CardHeader, CardContent, CardFooter, Card } from "@/app/dashboard/components/card" @@ -63,6 +63,7 @@ export default function Dashboard() { async function fetchUser() { try { const data = await getSelf(); + console.log(getUsers()); setUserData(data); // setLoading(false); } catch (error) { diff --git a/app/lib/data.ts b/app/lib/data.ts index 918c966..d628952 100644 --- a/app/lib/data.ts +++ b/app/lib/data.ts @@ -320,4 +320,110 @@ export async function getSelf() { "how_you_heard_about_hackru": "Mailing List", "reasons": "Learn new skills" }; + + + +} + + +export async function getUsers(){ + const Users: Record = {"testemail@gmail.com":{"role": { + "hacker": true, + "volunteer": false, + "judge": false, + "sponsor": false, + "mentor": false, + "organizer": false, + "director": false + }, + "votes": 0, + "github": "testgithub", + "major": "Computer Science", + "short_answer": "Things", + "shirt_size": "Unisex M", + "first_name": "Test", + "last_name": "User", + "dietary_restrictions": "", + "special_needs": "No", + "date_of_birth": "2000-01-01", + "school": "Rutgers, The State University of New Jersey", + "grad_year": "2026", + "gender": "Prefer not to say", + "registration_status": "unregistered", + "level_of_study": "University (Undergraduate)", + "day_of": { + "checkIn": false + }, + "token": [ + "faketoken" + ], + "country_of_residence": "US", + "ethnicity": "Prefer not to say", + "hackathon_count": "1", + "phone_number": "1234567890", + "how_you_heard_about_hackru": "Mailing List", + "reasons": "Learn new skills" + }}; + + const Names = ["Lauryn", "Underwood", + "Darius", "Peters", + "Eduardo", "Eaton", + "Jeremy", "Pitts", + "Trevor", "Valenzuela", + "Erica", "Mathews", + "Valentino", "Bowman", + "Hillary", "Hanson", + "Kody", "Shelton", + "Ariana", "Collins", + "Lina", "Fitzpatrick", + "Eve", "Flores"]; + + const registration_states = ["unregistered", "registered", "confirmation", "coming", "not_coming","waitlist", "confirmed", "rejected", "checked_in", "registered"] + + + for (let i = 0; i < 10; i++) { + const Random = Math.floor(Math.random() * 23); + const email = i.toString() + "@gmail.com"; + Users[email] = {"role": { + "hacker": true, + "volunteer": false, + "judge": false, + "sponsor": false, + "mentor": false, + "organizer": false, + "director": false + }, + "votes": 0, + "github": Names[Random] + "_Github", + "major": "Computer Science", + "short_answer": "Things", + "shirt_size": "Unisex M", + "first_name": Names[Random], + "last_name": Names[Random+1], + "dietary_restrictions": "", + "special_needs": "No", + "date_of_birth": "20"+ Random.toString() +"-01-" + Random.toString(), + "school": "Rutgers, The State University of New Jersey", + "grad_year": "20" + (Random + 20).toString() , + "gender": "Prefer not to say", + "registration_status": registration_states[i%10], + "level_of_study": "University (Undergraduate)", + "day_of": { + "checkIn": false + }, + "token": [ + "faketoken" + ], + "country_of_residence": "US", + "ethnicity": "Prefer not to say", + "hackathon_count": "1", + "phone_number": "1234567890", + "how_you_heard_about_hackru": "Mailing List", + "reasons": "Learn new skills" + }; + } + + return Users; + + }