Commit c93810f
fix(explore): send database backend as string in View Query format request
The View Query modal's SQL formatting toggle was returning a 400 Bad Request
error because the engine parameter was being sent as an object instead of a
string to the format_sql endpoint.
When the backend needs to be fetched from the dataset API, the code was
assigning the entire database object {backend: "postgresql"} rather than
extracting just the backend property string.
Changes:
- Use object destructuring to extract backend string from database object
- Add comprehensive test validating complete API payload structure
- Test verifies engine is sent as string, not object
Fixes #35682
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent a5eb02d commit c93810f
2 files changed
Lines changed: 28 additions & 1 deletion
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| |||
0 commit comments