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

Event to use a different method such as delete #259

Open
tim-habitat opened this issue Apr 2, 2024 · 0 comments
Open

Event to use a different method such as delete #259

tim-habitat opened this issue Apr 2, 2024 · 0 comments

Comments

@tim-habitat
Copy link
Contributor

It would be great to have an event where we can define the method we would like to be fired.
In particular, it would be useful to fire delete or put method.
e.g

@router.get("/")
async def example():
    return[ ...,
                c.Button(
                    text="Delete",
                    named_style="warning",
                    on_click=DeleteEvent("/delete") # or a more general one, as could be useful to have PUT
        )]

@router.delete("/delete/{id}")
async def delete(id):
    all.pop(id)
    return True
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

1 participant