( request: CreateSrcbookRequestType, )
| 35 | } |
| 36 | |
| 37 | export async function createSrcbook( |
| 38 | request: CreateSrcbookRequestType, |
| 39 | ): Promise<CreateSrcbookResponseType> { |
| 40 | const response = await fetch(API_BASE_URL + '/srcbooks', { |
| 41 | method: 'POST', |
| 42 | headers: { 'content-type': 'application/json' }, |
| 43 | body: JSON.stringify(request), |
| 44 | }); |
| 45 | |
| 46 | if (!response.ok) { |
| 47 | console.error(response); |
| 48 | throw new Error('Request failed'); |
| 49 | } |
| 50 | |
| 51 | return response.json(); |
| 52 | } |
| 53 | |
| 54 | export async function deleteSrcbook(request: { id: string }) { |
| 55 | const response = await fetch(API_BASE_URL + '/srcbooks/' + request.id, { |
no outgoing calls
no test coverage detected