Download wp-calypso/client/data/plugins/use-scheduled-updates-verify-path-query.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 586 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/data/plugins/use-scheduled-updates-verify-path-query.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/data/plugins/use-scheduled-updates-verify-path-query.ts
-
curl -L -o use-scheduled-updates-verify-path-query.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/data/plugins/use-scheduled-updates-verify-path-query.ts
586 Bytes
| import { useQuery, UseQueryResult } from '@tanstack/react-query'; | |
| import wpcomRequest from 'wpcom-proxy-request'; | |
| export const useScheduledUpdatesVerifyPathQuery = ( | |
| siteId: number, | |
| path: string, | |
| queryOptions = {} | |
| ): UseQueryResult< { available: boolean } > => { | |
| return useQuery( { | |
| queryKey: [ 'verify-path', siteId, path ], | |
| queryFn: () => | |
| wpcomRequest( { | |
| path: `/sites/${ siteId }/scheduled-updates/verify-path-status?path=${ path }`, | |
| method: 'GET', | |
| apiNamespace: 'wpcom/v2', | |
| } ), | |
| enabled: !! siteId && !! path, | |
| retry: false, | |
| ...queryOptions, | |
| } ); | |
| }; | |