feat: Implement mobile application and lead processing utilities.
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { trpc } from '@/lib/trpc'
|
||||
import { MOCK_STELLEN } from '@/lib/mock-data'
|
||||
|
||||
export function useStellenListe(opts?: { sparte?: string; lehrjahr?: string }) {
|
||||
return trpc.stellen.listPublic.useQuery({
|
||||
sparte: opts?.sparte,
|
||||
lehrjahr: opts?.lehrjahr,
|
||||
})
|
||||
let data = MOCK_STELLEN.filter((s) => s.aktiv)
|
||||
if (opts?.sparte) data = data.filter((s) => s.sparte === opts.sparte)
|
||||
if (opts?.lehrjahr) data = data.filter((s) => s.lehrjahr === opts.lehrjahr)
|
||||
return { data, isLoading: false, refetch: () => {}, isRefetching: false }
|
||||
}
|
||||
|
||||
export function useStelleDetail(id: string) {
|
||||
return trpc.stellen.byId.useQuery({ id })
|
||||
const data = MOCK_STELLEN.find((s) => s.id === id) ?? null
|
||||
return { data, isLoading: false }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user