diff --git a/common/js/types.d.ts b/common/js/types.d.ts index a56afe1a9..ad63f2766 100644 --- a/common/js/types.d.ts +++ b/common/js/types.d.ts @@ -87,10 +87,10 @@ export interface UnsuccessfulAPIResponse { * In the event of a successful API request, body is attached onto the request, which contains * endpoint-defined information about the response, such as database data. */ -export interface SuccessfulAPIResponse { +export interface SuccessfulAPIResponse { success: true; description: string; - body: unknown; + body: T; } export interface ChartFolderLookupDocument extends MongoDBDocument { chartID: string; diff --git a/common/src/types.ts b/common/src/types.ts index 6c27f058d..9b3a5d462 100644 --- a/common/src/types.ts +++ b/common/src/types.ts @@ -146,7 +146,7 @@ export interface UnsuccessfulAPIResponse { * In the event of a successful API request, body is attached onto the request, which contains * endpoint-defined information about the response, such as database data. */ -export interface SuccessfulAPIResponse { +export interface SuccessfulAPIResponse { success: true; description: string; // This isn't ideal, but we need to restrict @@ -154,7 +154,7 @@ export interface SuccessfulAPIResponse { // mandates indexability of the type, which makes // it unusable for known objects. // eslint-disable-next-line @typescript-eslint/ban-types - body: unknown; + body: T; } export interface ChartFolderLookupDocument extends MongoDBDocument {