Skip to content

Commit 9ee2ed1

Browse files
Write apidoc for topic
1 parent 208470e commit 9ee2ed1

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

_apidoc.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,3 +1411,66 @@
14111411
* @apiSuccess {Number} student.roll no of the student.
14121412
* @apiSuccess {ObjectId} student.coursesOpted by the student(ObjectId).
14131413
*/
1414+
1415+
// ------------------------------------------------------------------------------------------
1416+
// Topic.
1417+
// ------------------------------------------------------------------------------------------
1418+
1419+
/**
1420+
* @api {post} /topic/add Add topic
1421+
* @apiName AddTopic
1422+
* @apiGroup Topic
1423+
* @apiDescription Add a new Topic.
1424+
*
1425+
* @apiBody {String} Title of the content(topic).
1426+
*
1427+
* @apiSuccess {String} res Response message.
1428+
* @apiError (Error 500) DatabaseError Err message if there is an error inserting into the database.
1429+
*
1430+
* @apiSuccessExample Success-Response:
1431+
* HTTP/1.1 200 OK
1432+
* {
1433+
* "res": "Added topic"
1434+
* }
1435+
*
1436+
* @apiErrorExample Error-Response:
1437+
* HTTP/1.1 500 Internal Server Error
1438+
* {
1439+
* "err": "Error while inserting in DB"
1440+
* }
1441+
*/
1442+
1443+
/**
1444+
* @api {delete} /topic/delete/:topicId Delete Topic
1445+
* @apiName DeleteTopic
1446+
* @apiGroup Topic
1447+
*
1448+
* @apiParam {String} topicId The ID of the Topic document to delete.
1449+
*
1450+
* @apiSuccess {String} res Success message indicating the deletion.
1451+
*
1452+
* @apiError (Error 500) DatabaseError Error message if there was an error during the deletion.
1453+
*/
1454+
1455+
/**
1456+
* @api {post} /topic/update/:id Update Topic
1457+
* @apiName UpdateTopic
1458+
* @apiGroup Topic
1459+
* @apiDescription Update existing topic data.
1460+
*
1461+
* @apiParam {String} id The topic document to update.
1462+
*
1463+
* @apiSuccess {String} res Topic updated.
1464+
* @apiError (Error 500) DatabaseError Error in updating the database.
1465+
*/
1466+
1467+
/**
1468+
* @api {get} /topic/list Get Topic List
1469+
* @apiName GetTopicList
1470+
* @apiGroup Topic
1471+
*
1472+
* @apiQuery {String} Title of the content(topic).
1473+
*
1474+
* @apiSuccess {Topic[]} res Array of filtered topic documents.
1475+
* @apiSuccess {String} topic._id ID of the topic document given by the database.
1476+
*/

0 commit comments

Comments
 (0)