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

How to access link with method other than get? #137

Open
dev-guy opened this issue Jun 18, 2024 · 1 comment
Open

How to access link with method other than get? #137

dev-guy opened this issue Jun 18, 2024 · 1 comment

Comments

@dev-guy
Copy link

dev-guy commented Jun 18, 2024

https://elixirforum.com/t/how-to-access-link-with-method-other-than-get-within-livesvelte/64331

Has a solution, but is there an easier way or does this need to be documented?

The question

Hi, I’m trying to send a DELETE request to logout my user. I have phx.gen.auth in my project. It’s pretty straight forward in LiveView with .link, but I’m having a hard time replicating this with using LiveSvelte. I thought about using phx-click event, but the logout code from the session controller doesn’t have what it needs.

Is there a way to do some kind of delete request to the controller within the handle_event?
Or is there some easier way to handle this?

@dev-guy dev-guy changed the title How to access link with method other than get within LiveSvelte How to access link with method other than get? Jun 18, 2024
@woutdp
Copy link
Owner

woutdp commented Jun 19, 2024

I don't think there's an easy way here with what's available. I'd be up for an improvement on this front though

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