web&server: show raw body contents of UnhandledContentType

This commit is contained in:
2024-04-06 10:21:31 -07:00
parent d4038f40d6
commit 1b221d5c16
4 changed files with 56 additions and 5 deletions

View File

@@ -1505,6 +1505,22 @@
"ofType": null
}
}
},
{
"args": [],
"deprecationReason": null,
"description": null,
"isDeprecated": false,
"name": "contentTree",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
}
],
"inputFields": null,

View File

@@ -23,6 +23,7 @@ query ShowThreadQuery($threadId: String!) {
__typename
... on UnhandledContentType {
contents
contentTree
}
... on PlainText {
contents

View File

@@ -691,8 +691,13 @@ fn message_render(msg: &ShowThreadQueryThreadMessages, open: bool) -> Node<Msg>
C!["body"],
match &msg.body {
ShowThreadQueryThreadMessagesBody::UnhandledContentType(
ShowThreadQueryThreadMessagesBodyOnUnhandledContentType { contents },
) => pre![C!["error"], contents],
ShowThreadQueryThreadMessagesBodyOnUnhandledContentType { contents ,content_tree},
) => div![
raw_text_message(&contents),
div![C!["error"],
view_content_tree(&content_tree),
]
],
ShowThreadQueryThreadMessagesBody::PlainText(
ShowThreadQueryThreadMessagesBodyOnPlainText {
contents,