diff --git a/src/modules/grantee.ts b/src/modules/grantee.ts index 37ec1d68..23818e31 100644 --- a/src/modules/grantee.ts +++ b/src/modules/grantee.ts @@ -5,7 +5,7 @@ import { http } from '../utils/http' const granteeEndpoint = 'grantee' export async function getGrantees(reference: string, requestOptions: BeeRequestOptions): Promise { - const response = await http(requestOptions, { + const response = await http(requestOptions, { method: 'get', url: `${granteeEndpoint}/${reference}`, responseType: 'json', @@ -14,7 +14,7 @@ export async function getGrantees(reference: string, requestOptions: BeeRequestO return { status: response.status, statusText: response.statusText, - data: response.data.data, + data: response.data, } } @@ -26,7 +26,7 @@ export async function createGrantees( const response = await http(requestOptions, { method: 'post', url: granteeEndpoint, - data: { grantees: grantees }, + data: { grantees }, headers: { ...extractRedundantUploadHeaders(postageBatchId), }, diff --git a/src/types/index.ts b/src/types/index.ts index b4d8acea..503a84b4 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -9,10 +9,6 @@ import type { HexString } from '../utils/hex' export * from './debug' -export interface Dictionary { - [Key: string]: T -} - export const SPAN_SIZE = 8 export const SECTION_SIZE = 32 export const BRANCHES = 128 @@ -145,9 +141,9 @@ export interface UploadResult { export interface UploadOptions { /** * If set to true, an ACT will be created for the uploaded data. - * */ act?: boolean + /** * Will pin the data locally in the Bee node as well. * diff --git a/src/utils/http.ts b/src/utils/http.ts index 74e916b9..02d26174 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -23,12 +23,6 @@ export async function http(options: BeeRequestOptions, config: AxiosRequestCo maybeRunOnRequestHook(options, requestConfig) const response = await axios(requestConfig) - // Axios does not parse array of strings as JSON - if (Array.isArray(response.data) && response.data.every(element => typeof element === 'string')) { - const array = response.data as string[] - response.data = { data: array } as any - } - // TODO: https://github.com/axios/axios/pull/6253 return response as AxiosResponse } catch (e: unknown) {