From 7cc6c2c54745931057954aa9d31861a6a63ecadb Mon Sep 17 00:00:00 2001 From: Douglas Sebastian Date: Fri, 1 Dec 2023 22:51:04 -0300 Subject: [PATCH] change: ApiSucessResponse and ApiFailResponse --- src/types/UniversimeApi.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/types/UniversimeApi.ts b/src/types/UniversimeApi.ts index 9b6a574f..8aae9e80 100644 --- a/src/types/UniversimeApi.ts +++ b/src/types/UniversimeApi.ts @@ -1,8 +1,16 @@ -export type ApiResponse = { - success: boolean; +type ApiBaseResponse = { + success: Success; message?: string; redirectTo?: string; token?: string; - body?: ResponseBody; - alertOptions?: any; + body: ResponseBody; + alertOptions?: { + [k: string]: string; + }; }; + +export type ApiSuccessResponse = ApiBaseResponse; +export type ApiFailResponse = ApiBaseResponse; + +export type ApiResponse + = ApiSuccessResponse | ApiFailResponse;