IO-1124 Archive message
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user