Download wp-calypso/packages/data-stores/src/users/use-send-invites.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 472 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/data-stores/src/users/use-send-invites.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/data-stores/src/users/use-send-invites.ts
-
curl -L -o use-send-invites.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/data-stores/src/users/use-send-invites.ts
472 Bytes
| import { useMutation } from '@tanstack/react-query'; | |
| import wpcomRequest from 'wpcom-proxy-request'; | |
| interface Invitee { | |
| email_or_username: string; | |
| role: string; | |
| } | |
| export function useSendInvites( siteId: number ) { | |
| return useMutation( { | |
| mutationFn: ( invitees: Invitee[] ) => { | |
| return wpcomRequest( { | |
| path: `/sites/${ encodeURIComponent( siteId ) }/invites/new`, | |
| apiNamespace: 'wpcom/v2', | |
| method: 'POST', | |
| body: { invitees }, | |
| } ); | |
| }, | |
| } ); | |
| } | |