Skip to content
Source
Sign inSign up
TanStack/schemas
Open History to see the last commit

change-link.ts

13 lines480 Bytes

1/**
2 * Homepage and /changes rows. Model events use the catalog slug as
3 * subjectId, which GET /models/$provider/$modelId accepts.
4 */
5export function modelChangeHref(change: {
6 type: string
7 providerId: string
8 subjectId: string
9}): string | null {
10 if (!change.type.startsWith('model.')) return null
11 if (change.providerId === '' || change.subjectId === '') return null
12 return `/models/${encodeURIComponent(change.providerId)}/${encodeURIComponent(change.subjectId)}`