refactor(types): add unified API response types and error helpers
This commit is contained in:
8
dashboard/src/types/api.ts
Normal file
8
dashboard/src/types/api.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Unified API response type definition
|
||||
* Discriminated union for type-safe error handling
|
||||
*/
|
||||
|
||||
export type ApiResponse<T> =
|
||||
| { success: true; data: T }
|
||||
| { success: false; error: string }
|
||||
Reference in New Issue
Block a user