({
id,
message,
title,
files,
}: {
id: string;
message: string;
title?: string;
files: UploadedFile[];
})
| 647 | }; |
| 648 | |
| 649 | const editThread = ({ |
| 650 | id, |
| 651 | message, |
| 652 | title, |
| 653 | files, |
| 654 | }: { |
| 655 | id: string; |
| 656 | message: string; |
| 657 | title?: string; |
| 658 | files: UploadedFile[]; |
| 659 | }) => { |
| 660 | setThreads((threads) => { |
| 661 | return threads.map((thread) => { |
| 662 | if (thread.id === id) { |
| 663 | const messages = thread.messages; |
| 664 | messages[0].body = message; |
| 665 | return { |
| 666 | ...thread, |
| 667 | title, |
| 668 | messages, |
| 669 | }; |
| 670 | } |
| 671 | return thread; |
| 672 | }); |
| 673 | }); |
| 674 | return api |
| 675 | .updateThread({ |
| 676 | accountId: settings.communityId, |
| 677 | id, |
| 678 | title, |
| 679 | }) |
| 680 | .catch((_) => { |
| 681 | Toast.error('Failed to edit the thread.'); |
| 682 | }); |
| 683 | }; |
| 684 | |
| 685 | const editMessage = async ({ |
| 686 | id: messageId, |
nothing calls this directly
no test coverage detected