Skip to content

Commit

Permalink
Merge pull request #2154 from stakwork/bugfix/schema-update
Browse files Browse the repository at this point in the history
feat: fixed schema update handler
  • Loading branch information
Rassl authored Sep 19, 2024
2 parents 7ffb3a9 + 84472ce commit b2110e0
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 b2110e0

Please sign in to comment.