-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Employee searchbar has been connected to the backend
- Loading branch information
Sebastian Kondratowicz
committed
Sep 20, 2024
1 parent
f40a63b
commit b23f7de
Showing
6 changed files
with
99 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
import { People } from '@app/components/pages/People'; | ||
import { createClient } from '@app/utils/supabase/server'; | ||
import { userStatus } from '@app/types/user'; | ||
|
||
async function getPeople(status?: keyof typeof userStatus) { | ||
if (status) { | ||
const supabase = createClient(); | ||
const { data, error } = await supabase.rpc('get_employees_by_status', { _status: status }); | ||
|
||
if (error) { | ||
console.log('error', error); | ||
} else { | ||
return data; | ||
} | ||
} | ||
} | ||
|
||
export default async function PeoplePage({ searchParams }: { searchParams: { tab: keyof typeof userStatus } }) { | ||
const data = await getPeople(searchParams.tab); | ||
return <People data={data} />; | ||
export default async function PeoplePage() { | ||
return <People />; | ||
} |
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
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