Download wp-calypso/client/dashboard/data/site-preview-links.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 746 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/data/site-preview-links.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/dashboard/data/site-preview-links.ts
-
curl -L -o site-preview-links.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/data/site-preview-links.ts
746 Bytes
| import wpcom from 'calypso/lib/wp'; | |
| export interface SitePreviewLink { | |
| code: string; | |
| created_at: string; | |
| expires_at?: string; | |
| } | |
| export async function fetchSitePreviewLinks( siteId: number ): Promise< SitePreviewLink[] > { | |
| return wpcom.req.get( { | |
| path: `/sites/${ siteId }/preview-links`, | |
| apiNamespace: 'wpcom/v2', | |
| } ); | |
| } | |
| export async function createSitePreviewLink( siteId: number ): Promise< SitePreviewLink > { | |
| return wpcom.req.post( { | |
| path: `/sites/${ siteId }/preview-links`, | |
| apiNamespace: 'wpcom/v2', | |
| } ); | |
| } | |
| export async function deleteSitePreviewLink( siteId: number, code: string ) { | |
| return wpcom.req.post( { | |
| method: 'DELETE', | |
| path: `/sites/${ siteId }/preview-links/${ code }`, | |
| apiNamespace: 'wpcom/v2', | |
| } ); | |
| } | |