Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please add delete_item in workshop #163

Open
colining opened this issue Sep 5, 2024 · 1 comment
Open

please add delete_item in workshop #163

colining opened this issue Sep 5, 2024 · 1 comment

Comments

@colining
Copy link

colining commented Sep 5, 2024

if you fail in update_item process first time. it's should be delete , and create item again

here is my code, I'm nod good at rust, so please check my code,and add this function

thanks a lot

    #[napi]
    pub async fn delete_item(item_id: BigInt) -> Result<(), Error> {
        let client = crate::client::get_client();
        let (tx, rx) = oneshot::channel();

        client
            .ugc()
            .delete_item(PublishedFileId(item_id.get_u64().1), |result| {
                tx.send(result).unwrap();
            });

        let result = rx.await.unwrap();
        match result {
            Ok(()) => Ok(()),
            Err(e) => Err(Error::from_reason(e.to_string())),
        }
    }
@LZQCN
Copy link
Contributor

LZQCN commented Sep 14, 2024

You can fork this project, add your code, and then submit a PR (Pull Request).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants