1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-05-04 17:00:24 +00:00
bramw_baserow/web-frontend/modules/database/utils/form.js
2022-06-10 07:29:46 +00:00

11 lines
367 B
JavaScript

export function getPrefills(query) {
return Object.keys(query).reduce((prefills, key) => {
if (key.startsWith('prefill_')) {
const keyFormatted = key
.replace('prefill_', '') // Remove the prefix
.replaceAll('+', ' ') // Replace + with spaces
prefills[keyFormatted] = query[key]
}
return prefills
}, Object.create(null))
}