(name: string)
| 59 | export function createStorageAPI<T extends StorageEntity>(entityType: string) { |
| 60 | return { |
| 61 | async get(name: string): Promise<T> { |
| 62 | const response = await api.fetch<T>(`/${entityType}/${name}`); |
| 63 | if (response.error) throw new Error(response.error); |
| 64 | return response.data as T; |
| 65 | }, |
| 66 | |
| 67 | async getNames(): Promise<string[]> { |
| 68 | const response = await api.fetch<string[]>(`/${entityType}/names`); |
no outgoing calls
no test coverage detected