* Update a document * @param id * @param data * @returns
(id: string, data: Record<string, any>)
| 59 | * @returns |
| 60 | */ |
| 61 | async updateDocument(id: string, data: Record<string, any>): Promise<JSONDBReponse> { |
| 62 | const response = await fetch(getBackendUrl(`/db/collection/${this.collectionName}/${id}`), { |
| 63 | method: 'PUT', |
| 64 | headers: { |
| 65 | 'Content-Type': 'application/json', |
| 66 | }, |
| 67 | body: JSON.stringify(data), |
| 68 | }); |
| 69 | return response.json(); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * |
no test coverage detected