mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-03 04:18:16 +03:00
Generify APIResponse
This commit is contained in:
Vendored
+2
-2
@@ -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<T = unknown> {
|
||||
success: true;
|
||||
description: string;
|
||||
body: unknown;
|
||||
body: T;
|
||||
}
|
||||
export interface ChartFolderLookupDocument extends MongoDBDocument {
|
||||
chartID: string;
|
||||
|
||||
+2
-2
@@ -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<T = unknown> {
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user