diff --git a/app/src/interfaces/many-to-many/is-new.ts b/app/src/interfaces/many-to-many/is-new.ts deleted file mode 100644 index f735b2c856..0000000000 --- a/app/src/interfaces/many-to-many/is-new.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Ref } from '@vue/composition-api'; -import { Relation } from '@/types/'; -import { Field } from '@/types'; - -type IsNewContext = { - relationCurrentToJunction: Ref; - junctionCollectionPrimaryKeyField: Ref; - relatedCollectionPrimaryKeyField: Ref; -}; - -export default function isNew( - item: any, - { relationCurrentToJunction, junctionCollectionPrimaryKeyField, relatedCollectionPrimaryKeyField }: IsNewContext -) { - if (!relationCurrentToJunction.value) return; - if (!relationCurrentToJunction.value.junction_field) return; - - const junctionPrimaryKey = junctionCollectionPrimaryKeyField.value.field; - const junctionField = relationCurrentToJunction.value.junction_field; - const relatedPrimaryKey = relatedCollectionPrimaryKeyField.value.field; - const hasPrimaryKey = !!item[junctionPrimaryKey]; - const hasRelatedPrimaryKey = !!item[junctionField]?.[relatedPrimaryKey]; - - return hasPrimaryKey === false && hasRelatedPrimaryKey === false; -} diff --git a/app/src/interfaces/many-to-many/many-to-many.vue b/app/src/interfaces/many-to-many/many-to-many.vue index 8f68791697..488e8cd4e5 100644 --- a/app/src/interfaces/many-to-many/many-to-many.vue +++ b/app/src/interfaces/many-to-many/many-to-many.vue @@ -16,7 +16,7 @@