File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,11 +98,11 @@ export def "to datastar-redirect" []: string -> record {
9898 $" setTimeout\(\(\) => window.location.href = '($in )'\) ;" | to datastar-execute-script
9999}
100100
101- # Parse signals from request (GET query `datastar` param or POST body JSON )
101+ # Parse signals from request (POST/PUT/PATCH body JSON, or query param for GET/DELETE )
102102# Usage: $in | from datastar-signals $req
103103export def "from datastar-signals" [req : record ]: string -> record {
104104 match $req.method {
105- " POST " => (try { $in | from json } catch { {} })
106- _ => (try { $req.query.datastar ? | default " {} " | from json } catch { {} })
105+ " GET " | " DELETE " => (try { $req.query.datastar ? | default " {} " | from json } catch { {} })
106+ _ => (try { $in | from json } catch { {} })
107107 }
108108}
You can’t perform that action at this time.
0 commit comments