Download wp-calypso/client/dashboard/data/me-sites.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 701 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/data/me-sites.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/dashboard/data/me-sites.ts
-
curl -L -o me-sites.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/data/me-sites.ts
701 Bytes
| import wpcom from 'calypso/lib/wp'; | |
| import { JOINED_SITE_FIELDS, JOINED_SITE_OPTIONS } from './site'; | |
| import type { Site } from './site'; | |
| export interface FetchSitesOptions { | |
| include_a8c_owned: boolean; | |
| site_visibility: 'all' | 'visible' | 'hidden' | 'deleted'; | |
| } | |
| export async function fetchSites( { | |
| include_a8c_owned, | |
| site_visibility, | |
| }: FetchSitesOptions ): Promise< Site[] > { | |
| const { sites } = await wpcom.req.get( | |
| { | |
| path: '/me/sites', | |
| apiVersion: '1.2', | |
| }, | |
| { | |
| include_a8c_owned, | |
| include_domain_only: false, | |
| include_redirect: false, | |
| site_activity: 'active', | |
| site_visibility, | |
| fields: JOINED_SITE_FIELDS, | |
| options: JOINED_SITE_OPTIONS, | |
| } | |
| ); | |
| return sites; | |
| } | |