initial commit
This commit is contained in:
commit
c70fc72952
143 changed files with 13594 additions and 0 deletions
22
src/utils/data/blogroll.js
Normal file
22
src/utils/data/blogroll.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { createClient } from '@supabase/supabase-js';
|
||||
|
||||
const SUPABASE_URL = import.meta.env.SUPABASE_URL;
|
||||
const SUPABASE_KEY = import.meta.env.SUPABASE_KEY;
|
||||
const supabase = createClient(SUPABASE_URL, SUPABASE_KEY);
|
||||
|
||||
export async function fetchBlogroll() {
|
||||
const { data, error } = await supabase
|
||||
.from('authors')
|
||||
.select('*')
|
||||
.eq('blogroll', true)
|
||||
.order('name', { ascending: true });
|
||||
|
||||
if (error) {
|
||||
console.error('Error fetching authors for the blogroll:', error);
|
||||
return [];
|
||||
}
|
||||
|
||||
return data.sort((a, b) =>
|
||||
a.name.toLowerCase().localeCompare(b.name.toLowerCase())
|
||||
);
|
||||
};
|
Reference in a new issue