-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c0c547
commit cf323c4
Showing
5 changed files
with
39 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import supabase from '../createClient'; | ||
|
||
interface Resource { | ||
summary: string; | ||
[key: string]: any; | ||
} | ||
|
||
export const getHealingResourceData = async (): Promise<Resource[]> => { | ||
const { data, error } = await supabase.from('healing_resources').select('*'); | ||
if (error) { | ||
throw new Error(`Error fetching resources: ${error.message}`); | ||
} | ||
|
||
return data as Resource[]; | ||
}; | ||
|
||
export const getStateResourceData = async (): Promise<Resource[]> => { | ||
const { data, error } = await supabase | ||
.from('state_resources') | ||
.select('*') | ||
.in('state', ['California', 'National']); | ||
|
||
if (error) { | ||
throw new Error(`Error fetching resources: ${error.message}`); | ||
} | ||
return data as Resource[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface Resource { | ||
summary: string; | ||
[key: string]: any; | ||
} |