(
id: string,
data: { name?: string },
)
| 55 | }, |
| 56 | |
| 57 | async update( |
| 58 | id: string, |
| 59 | data: { name?: string }, |
| 60 | ): Promise<ApiTxResult<{ list: ShoppingList }> | null> { |
| 61 | const response = await offlineAwareFetch(`${API_URL}/api/lists/${id}`, { |
| 62 | method: 'PUT', |
| 63 | headers: { 'Content-Type': 'application/json' }, |
| 64 | body: JSON.stringify(data), |
| 65 | }) |
| 66 | if (response.status === 404) return null |
| 67 | if (!response.ok) { |
| 68 | throw new Error(`Failed to update list: ${response.status}`) |
| 69 | } |
| 70 | return response.json() |
| 71 | }, |
| 72 | |
| 73 | async delete(id: string): Promise<ApiTxResult<{ success: boolean }> | null> { |
| 74 | const response = await offlineAwareFetch(`${API_URL}/api/lists/${id}`, { |
nothing calls this directly
no outgoing calls
no test coverage detected