Simple Managment webapp [LLM]
This commit is contained in:
15
webapp/src/app/core/models/api-response.model.ts
Normal file
15
webapp/src/app/core/models/api-response.model.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export interface ApiError {
|
||||
success: false;
|
||||
error: number;
|
||||
errhighlight: number;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export function isApiError(response: unknown): response is ApiError {
|
||||
return (
|
||||
typeof response === 'object' &&
|
||||
response !== null &&
|
||||
'success' in response &&
|
||||
(response as ApiError).success === false
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user