Skip to content

Commit 806683d

Browse files
Fix: Update data loading for database changes
1 parent b3013a6 commit 806683d

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// This file is automatically generated. Do not edit it directly.
2+
import { createClient } from '@supabase/supabase-js';
3+
import type { Database } from './types';
4+
5+
const SUPABASE_URL = import.meta.env.VITE_SUPABASE_URL;
6+
const SUPABASE_PUBLISHABLE_KEY = import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY;
7+
8+
// Import the supabase client like this:
9+
// import { supabase } from "@/integrations/supabase/client";
10+
11+
export const supabase = createClient<Database>(SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, {
12+
auth: {
13+
storage: localStorage,
14+
persistSession: true,
15+
autoRefreshToken: true,
16+
}
17+
});

src/services/portfolio/experience.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export const fetchExperience = async (): Promise<Experience[]> => {
4040
return experienceCache;
4141
}
4242

43-
const { data: experienceData, error: experienceError } = await supabase.from('experiences')
43+
const { data: experienceData, error: experienceError } = await supabase
44+
.from('experiences')
4445
.select(`
4546
id,
4647
company,

src/services/portfolio/profile.service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ export const fetchProfile = async (): Promise<Profile | null> => {
4444
return null;
4545
}
4646

47-
// Fetch all skill categories
48-
const { data: skillsData, error: skillsError } = await supabase.from('skills').select(`
47+
// Fetch all skill categories with their items
48+
const { data: skillsData, error: skillsError } = await supabase
49+
.from('skills')
50+
.select(`
4951
id,
5052
category,
5153
skill_items (

src/services/portfolio/projects.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ export const fetchProjects = async (): Promise<Project[]> => {
4242
return projectsCache;
4343
}
4444

45-
const { data: projectsData, error: projectsError } = await supabase.from('projects').select(`
45+
const { data: projectsData, error: projectsError } = await supabase
46+
.from('projects')
47+
.select(`
4648
id,
4749
project_key,
4850
title,

0 commit comments

Comments
 (0)