IO-1124 Archive message

This commit is contained in:
Patrick Fic
2021-06-09 09:59:49 -07:00
parent a45bf6d959
commit 7a8e8de724
9 changed files with 116 additions and 10 deletions

View File

@@ -2,7 +2,11 @@ import { gql } from "@apollo/client";
export const CONVERSATION_LIST_SUBSCRIPTION = gql`
subscription CONVERSATION_LIST_SUBSCRIPTION {
conversations(order_by: { updated_at: desc }, limit: 100) {
conversations(
order_by: { updated_at: desc }
limit: 100
where: { archived: { _eq: false } }
) {
phone_num
id
job_conversations {
@@ -51,6 +55,7 @@ export const CONVERSATION_SUBSCRIPTION_BY_PK = gql`
}
id
phone_num
archived
job_conversations {
jobid
conversationid
@@ -87,3 +92,14 @@ export const CREATE_CONVERSATION = gql`
}
}
`;
export const TOGGLE_CONVERSATION_ARCHIVE = gql`
mutation TOGGLE_CONVERSATION_ARCHIVE($id: uuid!, $archived: Boolean) {
update_conversations_by_pk(
pk_columns: { id: $id }
_set: { archived: $archived }
) {
archived
}
}
`;