Hard-delete an inbox entry. Returns true on success, false if * the entry didn't exist (server replied 404).
(id: string)
| 84 | /** Hard-delete an inbox entry. Returns true on success, false if |
| 85 | * the entry didn't exist (server replied 404). */ |
| 86 | async delete(id: string): Promise<boolean> { |
| 87 | const res = await fetch(`/api/inbox/${encodeURIComponent(id)}`, { |
| 88 | method: 'DELETE', |
| 89 | }) |
| 90 | if (res.status === 204) return true |
| 91 | if (res.status === 404) return false |
| 92 | throw new Error(`inbox delete failed: ${res.status}`) |
| 93 | }, |
| 94 | |
| 95 | async markRead(id: string): Promise<{ ok: true; id: string; readAt: number }> { |
| 96 | return fetchJson(`/api/inbox/${encodeURIComponent(id)}/read`, { |