send array params as comma-separated values for rails

This commit is contained in:
Justin Edmund 2025-12-19 12:26:31 -08:00
parent d5a32b3953
commit 2ebe9ec086

View file

@ -431,11 +431,9 @@ export abstract class BaseAdapter {
// Skip undefined and null values
if (value === undefined || value === null) return
// Handle arrays by adding multiple params with the same key
// Handle arrays by joining values with commas (Rails-friendly format)
if (Array.isArray(value)) {
value.forEach((item) => {
url.searchParams.append(key, String(item))
})
url.searchParams.set(key, value.join(','))
} else {
url.searchParams.set(key, String(value))
}