-
Notifications
You must be signed in to change notification settings - Fork 179
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
fix(torii-sql): sql playground for slot #2779
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -374,7 +374,7 @@ | |||||
ORDER BY m.name, p.cid; | ||||||
`; | ||||||
const response = await fetch( | ||||||
"/sql?" + new URLSearchParams({ query: schemaQuery }) | ||||||
`${window.location.href}?` + new URLSearchParams({ query: schemaQuery }) | ||||||
); | ||||||
if (!response.ok) throw new Error("Failed to fetch schema"); | ||||||
const data = await response.json(); | ||||||
|
@@ -508,7 +508,7 @@ | |||||
const startTime = performance.now(); | ||||||
try { | ||||||
const response = await fetch( | ||||||
"/sql?" + new URLSearchParams({ query }) | ||||||
`${window.location.href}?` + new URLSearchParams({ query }) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Similar URL construction improvement needed here, sensei! For consistency and robustness, apply the same URL construction pattern here. Here's the suggested improvement: - `${window.location.href}?` + new URLSearchParams({ query })
+ `${new URL('sql', window.location.href)}?${new URLSearchParams({ query })}` 📝 Committable suggestion
Suggested change
|
||||||
); | ||||||
if (!response.ok) throw new Error(await response.text()); | ||||||
const data = await response.json(); | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Ohayo sensei! Consider improving URL construction.
The URL construction could be made more robust by handling trailing slashes and using proper URL joining.
Here's a suggested improvement:
This ensures:
📝 Committable suggestion