Skip to content

Commit

Permalink
hotfix(1.7.3): add ApiResponse custom type
Browse files Browse the repository at this point in the history
  • Loading branch information
jblewnormal committed Nov 23, 2024
1 parent df28a1e commit 93b683d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@normalfinance/utils",
"version": "1.7.2",
"version": "1.7.3",
"description": "A Typescript modules for frequently used types, utilities, constants, and more across Normal repositories.",
"homepage": "https://github.com/normalfinance/utils#readme",
"bugs": {
Expand Down
9 changes: 9 additions & 0 deletions src/types/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@ export enum AmountType {
BASE = 'BASE',
QUOTE = 'QUOTE',
}

export type ApiData<Type> = {
error: undefined;
data: Type;
};

export type ApiError = { error: string; data: undefined };

export type ApiResponse<Type> = ApiData<Type> | ApiError;

0 comments on commit 93b683d

Please sign in to comment.