3131 <LayoutTbody >
3232 <ContactListItem
3333 v-for =" contact in contacts "
34- :id =" contact .nodeId "
35- :key =" contact .nodeId "
34+ :id =" contact .rowId "
35+ :key =" contact .rowId "
3636 :contact
37- :is-deleting =" pending .deletions .includes (contact .nodeId )"
38- :is-editing =" pending .edits .includes (contact .nodeId )"
39- @delete =" delete_ (contact .nodeId , contact . id )"
37+ :is-deleting =" pending .deletions .includes (contact .rowId )"
38+ :is-editing =" pending .edits .includes (contact .rowId )"
39+ @delete =" delete_ (contact .rowId )"
4040 @edit =" edit (contact )"
4141 />
4242 </LayoutTbody >
6464</template >
6565
6666<script setup lang="ts">
67- import { useDeleteContactByIdMutation } from ' ~~/gql/documents/mutations/contact/contactDeleteById '
67+ import { useDeleteContactByRowIdMutation } from ' ~~/gql/documents/mutations/contact/contactDeleteByRowId '
6868import { useAllContactsQuery } from ' ~~/gql/documents/queries/contact/contactsAll'
6969import type { ContactItemFragment } from ' ~~/gql/generated/graphql'
7070import { getContactItem } from ' ~~/gql/documents/fragments/contactItem'
@@ -88,8 +88,8 @@ const selectedContact = ref<
8888 | ' firstName'
8989 | ' id'
9090 | ' lastName'
91- | ' nodeId'
9291 | ' phoneNumber'
92+ | ' rowId'
9393 | ' url'
9494 >
9595> ()
@@ -102,8 +102,8 @@ const contactsQuery = useAllContactsQuery(
102102 first: ITEMS_PER_PAGE_LARGE ,
103103 })),
104104)
105- const deleteContactByIdMutation = useDeleteContactByIdMutation ()
106- const api = await useApiData ([contactsQuery , deleteContactByIdMutation ])
105+ const deleteContactByRowIdMutation = useDeleteContactByRowIdMutation ()
106+ const api = await useApiData ([contactsQuery , deleteContactByRowIdMutation ])
107107const contacts = computed (
108108 () =>
109109 api .value .data .allContacts ?.nodes
@@ -118,10 +118,10 @@ const add = () => {
118118 selectedContact .value = undefined
119119 store .modals .push ({ id: ' ModalContact' })
120120}
121- const delete_ = async (nodeId : string , id : string ) => {
122- pending .deletions .push (nodeId )
123- await deleteContactByIdMutation .executeMutation ({ id })
124- pending .deletions .splice (pending .deletions .indexOf (nodeId ), 1 )
121+ const delete_ = async (rowId : string ) => {
122+ pending .deletions .push (rowId )
123+ await deleteContactByRowIdMutation .executeMutation ({ id: rowId })
124+ pending .deletions .splice (pending .deletions .indexOf (rowId ), 1 )
125125 // TODO: update cache, especially pagination, or reset query (https://github.com/maevsi/vibetype/issues/720)
126126}
127127const edit = (
@@ -133,12 +133,12 @@ const edit = (
133133 | ' firstName'
134134 | ' id'
135135 | ' lastName'
136- | ' nodeId'
137136 | ' phoneNumber'
137+ | ' rowId'
138138 | ' url'
139139 >,
140140) => {
141- pending .edits .push (contact .nodeId )
141+ pending .edits .push (contact .rowId )
142142 formContactHeading .value = t (' contactEdit' )
143143 selectedContact .value = contact
144144 store .modals .push ({ id: ' ModalContact' })
@@ -151,7 +151,7 @@ const onContactSubmitSuccess = () => {
151151const onModalContactClose = () => {
152152 if (! selectedContact .value ) return
153153
154- pending .edits .splice (pending .edits .indexOf (selectedContact .value .nodeId ), 1 )
154+ pending .edits .splice (pending .edits .indexOf (selectedContact .value .rowId ), 1 )
155155}
156156 </script >
157157
0 commit comments