Skip to content

Commit 4737ff7

Browse files
committed
fix: align datastar signal parsing with SDK ADR for DELETE method
1 parent 6934bee commit 4737ff7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/stdlib/datastar/mod.nu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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
103103
export 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
}

0 commit comments

Comments
 (0)