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

Form Actions #11

Open
Mohamed-Kaizen opened this issue May 28, 2023 · 0 comments
Open

Form Actions #11

Mohamed-Kaizen opened this issue May 28, 2023 · 0 comments

Comments

@Mohamed-Kaizen
Copy link

I was trying to make form action work, i was trying to to make it work thought the hook.server

import type { Handle } from "@sveltejs/kit"

export const handle = (async ({ event, resolve }) => {
 	if (event.request.method === "POST") {
 		const _url = event.request.url.split("?/")
 		const url = _url[0]
 		const action = _url[1]

 		event.request = new Request(url, event.request)
 		// Send it to the python server....
 		
 		// find  a way to resolve and return the data, from the python server...
 	}
 	const resp = await resolve(event)
 	return resp
}) satisfies Handle

currently with this code we can intercept the post request from the form and send it to the python server , the problem is the how to return the correct response.

I was thinking we can talk about ...how to handle the form actions with python

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