mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix: map block key management issue causing request failures due to invisible characters (#6521)
This commit is contained in:
parent
2e737f74fd
commit
1470ed902a
@ -32,11 +32,19 @@ const BaseConfiguration: React.FC<BaseConfigurationProps> = ({ type, children })
|
||||
return apiClient.resource(MapConfigurationResourceKey);
|
||||
}, [apiClient]);
|
||||
|
||||
function removeInvisibleCharsFromObject(obj: Record<string, string>): Record<string, string> {
|
||||
const cleanObj: Record<string, string> = {};
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
cleanObj[key] = typeof value === 'string' ? value.replace(/[\p{C}\p{Z}\p{Zl}\p{Zp}]+/gu, '') : value;
|
||||
}
|
||||
return cleanObj;
|
||||
}
|
||||
|
||||
const onSubmit = async (values) => {
|
||||
await form.validateFields();
|
||||
resource
|
||||
.set({
|
||||
...values,
|
||||
...removeInvisibleCharsFromObject(values),
|
||||
type,
|
||||
})
|
||||
.then((res) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user