Skip to content

Commit

Permalink
fix: create conversation when message is present (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
Himali-Malvawala authored Jun 13, 2024
1 parent f6d0245 commit 058da1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tasks/components/NewTask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const NewTask = (props: Props) => {
const handleSave = async () => {
if (validate()) {
const tasks = await ApiHelper.post("/tasks", [task], "DoingApi");
if (message.content?.trim() !== "") {
if (message.content && (message.content?.trim() !== undefined || message.content?.trim() !== "")) {

const conv: ConversationInterface = { allowAnonymousPosts: false, contentType: "task", contentId: task.id, title: "Task #" + tasks[0].id + " Notes", visibility: "hidden" }
const result: ConversationInterface[] = await ApiHelper.post("/conversations", [conv], "MessagingApi");
Expand All @@ -49,8 +49,8 @@ export const NewTask = (props: Props) => {
message.conversationId = t.conversationId;
//message.contentId = tasks[0].id;
await ApiHelper.post("/messages", [message], "MessagingApi");
props.onSave();
}
props.onSave();
}
}

Expand Down

0 comments on commit 058da1b

Please sign in to comment.