Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: function argument onFormArrayChange

phamhieu473eb94d4777
diff --git a/studio/components/interfaces/Database/Functions/CreateFunction.tsx b/studio/components/interfaces/Database/Functions/CreateFunction.tsx
index 502dc170993..c2594759f44 100644
--- a/studio/components/interfaces/Database/Functions/CreateFunction.tsx
+++ b/studio/components/interfaces/Database/Functions/CreateFunction.tsx
@@ -195,27 +195,34 @@ class CreateFunctionStore implements ICreateFunctionStore {
switch (operation) {
case 'add': {
if (has(this.formState, key)) {
- ;(this.formState as any)[key].value.push(value)
+ // @ts-ignore
+ this.formState[key].value.push(value)
} else {
- ;(this.formState as any)[key] = { value: [value] }
+ const values = [value]
+ // @ts-ignore
+ this.formState[key] = { value: [value] }
}
break
}
case 'delete': {
if (has(this.formState, key)) {
const temp = filter(
- (this.formState as any)[key].value,
+ // @ts-ignore
+ this.formState[key].value,
(_: any, index: number) => index != idx
) as any
- ;(this.formState as any)[key].value = temp
+ // @ts-ignore
+ this.formState[key].value = temp
}
break
}
default: {
- if (has(this.formState, key) && idx) {
- ;(this.formState as any)[key].value[idx] = value
+ if (has(this.formState, key) && idx != undefined) {
+ // @ts-ignore
+ this.formState[key].value[idx] = value
} else {
- ;(this.formState as any)[key] = { value: [{ value }] }
+ // @ts-ignore
+ this.formState[key] = { value: [value] }
}
}
}