Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / frontend/src/tools/recruitmatch/taskQueries.ts |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | frontend/src/tools/recruitmatch/taskQueries.ts |
| Original SHA-256 | 19b4abe871f9354c34dc7158827bb126a0bebb779ec1ed395b48fad281947879 |
| Git blob SHA | 0aa996f4b4c0e49a778bb8d6f8bb0c0276e3c927 |
| Reading-copy SHA-256 | 19b4abe871f9354c34dc7158827bb126a0bebb779ec1ed395b48fad281947879 |
Every recorded occurrence
These 2 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/missionmatch / frontend/src/tools/recruitmatch/taskQueries.ts | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / frontend/src/tools/recruitmatch/taskQueries.ts | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
Recovered source transcript
Download complete source text ↓49 lines · 1.5 KB
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import { taskApi } from './taskApi'
export function useTaskQueue(assignee?: string, includeClosed?: boolean) {
return useQuery({
queryKey: ['recruitmatch', 'task-queue', assignee ?? '', includeClosed ?? false],
queryFn: () => taskApi.queue(assignee, includeClosed),
})
}
export function useTasksFor(scope: { candidate_id?: string; requisition_id?: string; application_id?: string }) {
return useQuery({
queryKey: ['recruitmatch', 'tasks', scope],
queryFn: () => taskApi.list(scope),
})
}
function useInvalidate() {
const qc = useQueryClient()
return () => {
void qc.invalidateQueries({ queryKey: ['recruitmatch', 'task-queue'] })
void qc.invalidateQueries({ queryKey: ['recruitmatch', 'tasks'] })
}
}
export function useCreateTask() {
const inv = useInvalidate()
return useMutation({ mutationFn: taskApi.create, onSuccess: inv })
}
export function useUpdateTask() {
const inv = useInvalidate()
return useMutation({
mutationFn: (v: { id: string; patch: Record<string, unknown> }) => taskApi.update(v.id, v.patch),
onSuccess: inv,
})
}
// Changing the timezone moves what "today" means for every count in the product, so everything that
// buckets by day is invalidated, not just the queue.
export function useSetTimeZone() {
const qc = useQueryClient()
return useMutation({
mutationFn: (tz: string) => taskApi.setTimeZone(tz),
onSuccess: () => qc.invalidateQueries({ queryKey: ['recruitmatch'] }),
})
}