Files
SimpleCloudNotifier/webapp/src/app/core/models/api-response.model.ts

16 lines
332 B
TypeScript

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
);
}