Skip to content

Commit

Permalink
feat: fixed schema update handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Rassl committed Sep 18, 2024
1 parent 3679f4d commit 84472ce
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Text } from '~/components/common/Text'
import { TextInput } from '~/components/common/TextInput'
import { NODE_ADD_ERROR, requiredRule } from '~/constants'
import { api } from '~/network/api'
import { getNodeSchemaTypes, getNodeType, Schema, editNodeSchemaUpdate } from '~/network/fetchSourcesData'
import { editNodeSchemaUpdate, getNodeSchemaTypes, getNodeType, Schema } from '~/network/fetchSourcesData'
import { useModal } from '~/stores/useModalStore'
import { colors } from '~/utils'
import { CreateCustomNodeAttribute } from './CustomAttributesStep'
Expand Down Expand Up @@ -71,7 +71,8 @@ const handleSubmitForm = async (
mediaOptions: { videoAudio: boolean; image: boolean; sourceLink: boolean },
): Promise<string | undefined> => {
try {
const { attributes, selectedIndex, ...withoutAttributes } = data
// eslint-disable-next-line camelcase
const { attributes, selectedIndex, ref_id, ...withoutAttributes } = data

const updatedAttributes = {
...convertAttributes(attributes),
Expand Down Expand Up @@ -262,7 +263,8 @@ export const Editor = ({
const attributesValue = watch('attributes')

const attributes: Attribute[] = useMemo(
() => (isAttributeArray(attributesValue) ? attributesValue.filter((attr) => attr.key.trim() !== '') : []),
() =>
isAttributeArray(attributesValue) ? attributesValue.filter((attr) => attr.key && attr.key.trim() !== '') : [],
[attributesValue],
)

Expand Down

0 comments on commit 84472ce

Please sign in to comment.