forked from keephq/keep
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from rajeshj11/feat-1779-main
feat: added the quality metrics stats logic in backend and minor modification on forntend
- Loading branch information
Showing
5 changed files
with
129 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useSession } from "next-auth/react"; | ||
import { getApiURL } from "../apiUrl"; | ||
import { SWRConfiguration } from "swr"; | ||
import { fetcher } from "../fetcher"; | ||
import useSWRImmutable from "swr/immutable"; | ||
|
||
export const useAlertQualityMetrics = (options: SWRConfiguration = {}) => { | ||
const { data: session } = useSession(); | ||
const apiUrl = getApiURL(); | ||
|
||
// TODO: Proper type needs to be defined. | ||
return useSWRImmutable<Record<string, Record<string, any>>>( | ||
() => (session ? `${apiUrl}/alerts/quality/metrics` : null), | ||
(url) => fetcher(url, session?.accessToken), | ||
options | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters