Skip to content

Commit

Permalink
adds queries to profile table in supabase
Browse files Browse the repository at this point in the history
  • Loading branch information
rahihazra committed Oct 10, 2023
1 parent 0e673eb commit 96a8287
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 165 deletions.
156 changes: 0 additions & 156 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 13 additions & 9 deletions src/app/profile/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use client';

// import { useEffect } from 'react';
// import { getAllCases } from '../../api/supabase/queries/cases';

// import { error } from 'console';
import 'crypto';
import React, { useEffect, useState } from 'react';
import {
Expand All @@ -9,6 +13,7 @@ import {
} from '../../api/supabase/queries/profiles';
import { Profile } from '../../types/schemaTypes';

// import { SupabaseAuthClient } from '@supabase/supabase-js/dist/module/lib/SupabaseAuthClient';
import styles from '../page.module.css';

export default function Page() {
Expand All @@ -22,8 +27,6 @@ export default function Page() {
type UUID = `${string}-${string}-${string}-${string}-${string}`;

const mockProfile = {
first_name: 'First',
last_name: 'Last',
user_id: crypto.randomUUID() as UUID,
roles: ['attorney'],
languages: ['English', 'Spanish'],
Expand All @@ -40,6 +43,8 @@ export default function Page() {
await updateProfile(mockProfile.user_id, {
hours_per_week: 100, // Update the roles field with new data
});

console.log('test');
})();
}, []);

Expand All @@ -51,18 +56,17 @@ export default function Page() {
{profiles.map(profile => (
<li key={profile.user_id}>
<h2>Profile ID: {profile.user_id}</h2>
<p>First Name: {profile.first_name}</p>
<p>Last Name: {profile.last_name}</p>
<p>Roles: {profile.roles.join(', ')}</p>
<p>Languages: {profile.languages.join(', ')}</p>
<p>Accreditations: {profile.accreditations.join(', ')}</p>
<p>hoursPerWeek: {profile.hours_per_week}</p>
<p>hoursPerWeek: {profile.hours_per_week.toString()}</p>
<p>
immigrationLawExperience: {profile.immigration_law_experience}
immigrationLawExperience:{' '}
{profile.immigration_law_experience.toString()}
</p>
<p>barNumber: {profile.bar_number}</p>
<p>startDate: {profile.start_date}</p>
<p>interestIds: {profile.interest_ids}</p>
<p>barNumber: {profile.bar_number.toString()}</p>
<p>startDate: {profile.start_date.toString()}</p>
<p>interestIds: {profile.interest_ids.toString()}</p>
</li>
))}
</ul>
Expand Down

0 comments on commit 96a8287

Please sign in to comment.