Improe chat response handling for archive/tagging.
This commit is contained in:
@@ -13,6 +13,7 @@ export default function ChatArchiveButton({ conversation }) {
|
||||
|
||||
await updateConversation({
|
||||
variables: { id: conversation.id, archived: !conversation.archived },
|
||||
refetchQueries: ["CONVERSATION_LIST_QUERY"],
|
||||
});
|
||||
|
||||
setLoading(false);
|
||||
|
||||
@@ -16,6 +16,16 @@ export default function ChatConversationTitleTags({ jobConversations }) {
|
||||
conversationId: convId,
|
||||
jobId: jobId,
|
||||
},
|
||||
update(cache) {
|
||||
cache.modify({
|
||||
id: cache.identify({ id: convId, __typename: "conversations" }),
|
||||
fields: {
|
||||
job_conversations(ex) {
|
||||
return ex.filter((e) => e.jobid !== jobId);
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
logImEXEvent("messaging_remove_job_tag", {
|
||||
conversationId: convId,
|
||||
|
||||
@@ -42,6 +42,7 @@ export const CONVERSATION_LIST_QUERY = gql`
|
||||
id
|
||||
updated_at
|
||||
unreadcnt
|
||||
archived
|
||||
messages_aggregate(
|
||||
where: { read: { _eq: false }, isoutbound: { _eq: false } }
|
||||
) {
|
||||
@@ -131,6 +132,7 @@ export const TOGGLE_CONVERSATION_ARCHIVE = gql`
|
||||
_set: { archived: $archived }
|
||||
) {
|
||||
archived
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -9,6 +9,20 @@ export const INSERT_CONVERSATION_TAG = gql`
|
||||
returning {
|
||||
jobid
|
||||
conversationid
|
||||
id
|
||||
conversation {
|
||||
id
|
||||
job_conversations {
|
||||
id
|
||||
jobid
|
||||
conversationid
|
||||
job {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user