mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-13 09:41:30 +08:00

* refactor: remove the dependency of services using redux * refactor: seperated columns and unit test case * refactor: move the constant to other file * refactor: updated test case * refactor: removed the duplicate enum * fix: removed the inline function * fix: removed the inline function * refactor: removed the magic string * fix: change the name from matrics to metrics * fix: one on one mapping of props * refactor: created a hook to getting services through api call * fix: linter error * refactor: renamed the file according to functionality * refactor: renamed more file according to functionality * refactor: removed unwanted interfaces and renamed files * refactor: separated types * refactor: shifted mock data and completed review changes * chore: updated test cases * refactor: added useEffect in errornotification * chore: updated service test * chore: shifted loading to table level * chore: updated test cases --------- Co-authored-by: Vishal Sharma <makeavish786@gmail.com>
18 lines
410 B
TypeScript
18 lines
410 B
TypeScript
import { AxiosError } from 'axios';
|
|
import { useEffect } from 'react';
|
|
|
|
import { useNotifications } from './useNotifications';
|
|
|
|
const useErrorNotification = (error: AxiosError | null): void => {
|
|
const { notifications } = useNotifications();
|
|
useEffect(() => {
|
|
if (error) {
|
|
notifications.error({
|
|
message: error.message,
|
|
});
|
|
}
|
|
}, [error, notifications]);
|
|
};
|
|
|
|
export default useErrorNotification;
|