chore: worker cleanup
This commit is contained in:
parent
8b2648f23f
commit
3aadaeb741
10 changed files with 464 additions and 425 deletions
19
workers/dynamic-pages/utils/fetchers.js
Normal file
19
workers/dynamic-pages/utils/fetchers.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
export const fetchDataByUrl = async (supabase, table, url) => {
|
||||
const { data, error } = await supabase.from(table).select('*').eq('url', url).single()
|
||||
|
||||
if (error) {
|
||||
console.error(`Error fetching from ${table}:`, error)
|
||||
return null
|
||||
}
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
export const fetchGlobals = async (supabase) => {
|
||||
const { data, error } = await supabase.from('optimized_globals').select('*').single()
|
||||
if (error) {
|
||||
console.error('Error fetching globals:', error)
|
||||
return {}
|
||||
}
|
||||
return data
|
||||
}
|
Reference in a new issue