-
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.
[organization] cleaned up code (#11)
Co-authored-by: philipye314 <[email protected]>
- Loading branch information
1 parent
3c0c547
commit 79337e2
Showing
4 changed files
with
35 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Resource } from '@/types/types'; | ||
import supabase from '../createClient'; | ||
|
||
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 getSeekHelpData = 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; | ||
} |