MCPcopy Create free account
hub / github.com/TanStack/db / create

Function create

examples/react-native/shopping-list/src/utils/api.ts:41–55  ·  view source on GitHub ↗
(data: {
    id?: string
    name: string
    createdAt?: string
  })

Source from the content-addressed store, hash-verified

39 },
40
41 async create(data: {
42 id?: string
43 name: string
44 createdAt?: string
45 }): Promise<ApiTxResult<{ list: ShoppingList }>> {
46 const response = await offlineAwareFetch(`${API_URL}/api/lists`, {
47 method: 'POST',
48 headers: { 'Content-Type': 'application/json' },
49 body: JSON.stringify(data),
50 })
51 if (!response.ok) {
52 throw new Error(`Failed to create list: ${response.status}`)
53 }
54 return response.json()
55 },
56
57 async update(
58 id: string,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected