Skip to content

Commit 8412126

Browse files
committed
Documented the new endpoint for the swagger docs!
1 parent c6b484f commit 8412126

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

src/routes/chat.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,55 @@ router.delete(
248248
chatController.deleteGroupChat // Controller to handle the logic
249249
);
250250

251+
/**
252+
* @swagger
253+
* /typing-status:
254+
* patch:
255+
* summary: Update typing status in a chat
256+
* tags: [Chat]
257+
* requestBody:
258+
* required: true
259+
* content:
260+
* application/json:
261+
* schema:
262+
* type: object
263+
* properties:
264+
* email:
265+
* type: string
266+
* description: Email of the user updating typing status
267+
* chatID:
268+
* type: string
269+
* description: ID of the chat
270+
* isTyping:
271+
* type: boolean
272+
* description: Typing status (true if typing, false otherwise)
273+
* example:
274+
* email: "user@example.com"
275+
* chatID: "chatId123"
276+
* isTyping: true
277+
* responses:
278+
* 200:
279+
* description: Typing status updated successfully
280+
* content:
281+
* application/json:
282+
* schema:
283+
* type: object
284+
* properties:
285+
* chatID:
286+
* type: string
287+
* description: ID of the chat
288+
* email:
289+
* type: string
290+
* description: Email of the user
291+
* isTyping:
292+
* type: boolean
293+
* description: Typing status
294+
* 404:
295+
* description: Chat not found
296+
* 400:
297+
* description: Invalid input
298+
*/
299+
251300
// Route to update typing status
252301
router.patch(
253302
"/typing-status",

0 commit comments

Comments
 (0)