You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This ticket aims to enhance the chat functionality by introducing a PUT endpoint to update chat details. This feature is necessary to allow users to modify existing chat information, such as the title, without creating a new chat. It fits into the larger system by improving the flexibility and usability of the chat service.
This will update the chat object int he DB, not the chatMessage - for example this will allow us to update the title on a chat, which will in turn update the Chat History Component on Workspace and the Chat on the Hivechat main view.
Task
Implement a new PUT endpoint at /hivechat/{chat_id} in the chat.go file.
Ensure the endpoint accepts a payload that includes the chat fields to be updated.
Implement a handler function chatHandler.UpdateChat to manage updates
Update only the fields provided in the payload, along with the update timestamp.
Integrate the new endpoint into the existing router group.
Outcome
The system will have a functional PUT endpoint that allows users to update specific fields of a chat, enhancing the chat management capabilities.
Payload: Accepts a JSON object with fields to be updated.
Logic:
Parse the incoming request to extract the fields.
Validate the fields and update the corresponding chat record in the database.
Update the timestamp to reflect the modification time.
Payload from the front end will be in the form.
{
id: string; // Passed as an ID for the chat not a change
workspaceId: string; // Passed as an ID for the chat not a change
title: string; // This is what we will likely be changed
}
Acceptance Criteria
The PUT endpoint is accessible at /hivechat/{chat_id}.
The endpoint correctly updates only the fields provided in the request payload.
The update timestamp is modified upon a successful update.
The endpoint returns appropriate success and error responses.
Unit tests are written to cover various update scenarios.
The text was updated successfully, but these errors were encountered:
Ticket Name: Add PUT Endpoint to Update Chats
Context
This ticket aims to enhance the chat functionality by introducing a PUT endpoint to update chat details. This feature is necessary to allow users to modify existing chat information, such as the title, without creating a new chat. It fits into the larger system by improving the flexibility and usability of the chat service.
This will update the
chat
object int he DB, not thechatMessage
- for example this will allow us to update the title on a chat, which will in turn update the Chat History Component on Workspace and the Chat on the Hivechat main view.Task
/hivechat/{chat_id}
in thechat.go
file.chatHandler.UpdateChat
to manage updatesOutcome
The system will have a functional PUT endpoint that allows users to update specific fields of a chat, enhancing the chat management capabilities.
Design
PUT /hivechat/{chat_id}
Payload from the front end will be in the form.
Acceptance Criteria
/hivechat/{chat_id}
.The text was updated successfully, but these errors were encountered: