react-code-dataset / wp-calypso /client /data /plugins /use-scheduled-updates-notification-settings-query.ts
react-code-dataset / wp-calypso /client /data /plugins /use-scheduled-updates-notification-settings-query.ts
Download wp-calypso/client/data/plugins/use-scheduled-updates-notification-settings-query.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 704 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/data/plugins/use-scheduled-updates-notification-settings-query.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/data/plugins/use-scheduled-updates-notification-settings-query.ts
-
curl -L -o use-scheduled-updates-notification-settings-query.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/data/plugins/use-scheduled-updates-notification-settings-query.ts
704 Bytes
| import { useQuery } from '@tanstack/react-query'; | |
| import wpcomRequest from 'wpcom-proxy-request'; | |
| import type { SiteSlug } from 'calypso/types'; | |
| export type ScheduledUpdatesNotificationSettings = { | |
| success: boolean; | |
| failure: boolean; | |
| }; | |
| export const useScheduledUpdatesNotificationSettingsQuery = ( siteSlug: SiteSlug ) => { | |
| return useQuery< ScheduledUpdatesNotificationSettings, Error >( { | |
| queryKey: [ 'scheduled-updates-notification-settings', siteSlug ], | |
| queryFn: () => | |
| wpcomRequest( { | |
| path: `/sites/${ siteSlug }/scheduled-updates/notifications`, | |
| apiNamespace: 'wpcom/v2', | |
| method: 'GET', | |
| } ), | |
| enabled: !! siteSlug, | |
| retry: false, | |
| refetchOnWindowFocus: false, | |
| } ); | |
| }; | |