(id: string, data: T)
| 23 | } |
| 24 | |
| 25 | async createDocument(id: string, data: T): Promise<JSONDBReponse> { |
| 26 | const response = await fetch(getBackendUrl(`/db/collection/${this.collectionName}/${id}`), { |
| 27 | method: 'POST', |
| 28 | headers: { |
| 29 | 'Content-Type': 'application/json', |
| 30 | }, |
| 31 | body: JSON.stringify(data), |
| 32 | }); |
| 33 | return response.json(); |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Get all documents |
no test coverage detected