Download wp-calypso/client/mailing-lists/utils.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 643 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/mailing-lists/utils.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/mailing-lists/utils.js
-
curl -L -o utils.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/mailing-lists/utils.js
643 Bytes
| import wpcom from 'calypso/lib/wp'; | |
| function createSubscriberResourceUrl( category, emailAddress, method ) { | |
| return ( | |
| '/mailing-lists/' + | |
| encodeURIComponent( category ) + | |
| '/subscribers/' + | |
| encodeURIComponent( emailAddress ) + | |
| '/' + | |
| method | |
| ); | |
| } | |
| export function deleteSubscriber( category, emailAddress, hmac, context ) { | |
| return wpcom.req.post( createSubscriberResourceUrl( category, emailAddress, 'delete' ), { | |
| hmac, | |
| context, | |
| } ); | |
| } | |
| export function addSubscriber( category, emailAddress, hmac, context ) { | |
| return wpcom.req.post( createSubscriberResourceUrl( category, emailAddress, 'new' ), { | |
| hmac, | |
| context, | |
| } ); | |
| } | |