Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / frontend/src/tools/recruitmatch/clientsApi.ts |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | frontend/src/tools/recruitmatch/clientsApi.ts |
| Original SHA-256 | 09cc1290df8fa50a40ad7a763395d1bc1922a82e7b9cbf654188c1c984952f26 |
| Git blob SHA | bdafbb0cdad77af8d80b4b26fe35f6b8bd12e566 |
| Reading-copy SHA-256 | 09cc1290df8fa50a40ad7a763395d1bc1922a82e7b9cbf654188c1c984952f26 |
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/clientsApi.ts | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / frontend/src/tools/recruitmatch/clientsApi.ts | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
Recovered source transcript
Download complete source text ↓35 lines · 2.0 KB
import { request } from '../../lib/api'
import type { RClient, RClientDetail, RClientList, RContact } from '../../lib/types'
const NS = '/recruiting'
const body = (v: unknown) => ({ body: JSON.stringify(v) })
export const clientsApi = {
list: (p: { status?: string; q?: string; owner?: string; limit?: number; offset?: number }) => {
const s = new URLSearchParams()
if (p.status) s.set('status', p.status)
if (p.q) s.set('q', p.q)
if (p.owner) s.set('owner', p.owner)
if (p.limit) s.set('limit', String(p.limit))
if (p.offset) s.set('offset', String(p.offset))
const qs = s.toString()
return request<RClientList>(`${NS}/clients${qs ? `?${qs}` : ''}`)
},
get: (id: string) => request<RClientDetail>(`${NS}/clients/${encodeURIComponent(id)}`),
create: (v: { name: string; uei?: string; industry?: string; website?: string; status?: string; notes?: string }) =>
request<RClient>(`${NS}/clients`, { method: 'POST', ...body(v) }),
// expected_updated_at is required by the server. Sending the value read with the row is what turns a
// lost update into a refusal.
update: (id: string, v: Record<string, unknown>) =>
request<RClient>(`${NS}/clients/${encodeURIComponent(id)}`, { method: 'PATCH', ...body(v) }),
claim: (id: string) => request<RClient>(`${NS}/clients/${encodeURIComponent(id)}/claim`, { method: 'POST' }),
release: (id: string) => request<RClient>(`${NS}/clients/${encodeURIComponent(id)}/release`, { method: 'POST' }),
reassign: (id: string, owner_user_id: string) =>
request<RClient>(`${NS}/clients/${encodeURIComponent(id)}/reassign`, { method: 'POST', ...body({ owner_user_id }) }),
addContact: (clientId: string, v: Record<string, unknown>) =>
request<RContact>(`${NS}/clients/${encodeURIComponent(clientId)}/contacts`, { method: 'POST', ...body(v) }),
updateContact: (id: string, v: Record<string, unknown>) =>
request<RContact>(`${NS}/contacts/${encodeURIComponent(id)}`, { method: 'PATCH', ...body(v) }),
}