Skip to content

Commit 1e188bd

Browse files
Merge pull request #396 from tcet-opensource/255-Write-apidoc-for-topic
write apidocs for topic
2 parents 1d41b56 + 4ed531a commit 1e188bd

File tree

1 file changed

+64
-1
lines changed

1 file changed

+64
-1
lines changed

_apidoc.js

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,35 @@
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+
14141443
// ------------------------------------------------------------------------------------------
14151444
// Faculty
14161445
// ------------------------------------------------------------------------------------------
@@ -1452,6 +1481,18 @@
14521481
* }
14531482
*/
14541483

1484+
/**
1485+
* @api {delete} /topic/delete/:topicId Delete Topic
1486+
* @apiName DeleteTopic
1487+
* @apiGroup Topic
1488+
*
1489+
* @apiParam {String} topicId The ID of the Topic document to delete.
1490+
*
1491+
* @apiSuccess {String} res Success message indicating the deletion.
1492+
*
1493+
* @apiError (Error 500) DatabaseError Error message if there was an error during the deletion.
1494+
*/
1495+
14551496
/**
14561497
* @api {delete} /faculty/delete/:facultyId Delete Faculty
14571498
* @apiName DeleteFaculty
@@ -1464,6 +1505,17 @@
14641505
* @apiError (Error 500) DatabaseError Error message if there was an error during the deletion.
14651506
*/
14661507

1508+
/**
1509+
* @api {post} /topic/update/:id Update Topic
1510+
* @apiName UpdateTopic
1511+
* @apiGroup Topic
1512+
* @apiDescription Update existing topic data.
1513+
*
1514+
* @apiParam {String} id The topic document to update.
1515+
*
1516+
* @apiSuccess {String} res Topic updated.
1517+
* @apiError (Error 500) DatabaseError Error in updating the database.
1518+
*/
14671519
/**
14681520
* @api {post} /faculty/update/:id Update Faculty
14691521
* @apiName UpdateFaculty
@@ -1492,6 +1544,17 @@
14921544
* @apiError (Error 500) DatabaseError Error in updating the database.
14931545
*/
14941546

1547+
/**
1548+
* @api {get} /topic/list Get Topic List
1549+
* @apiName GetTopicList
1550+
* @apiGroup Topic
1551+
*
1552+
* @apiQuery {String} Title of the content(topic).
1553+
*
1554+
* @apiSuccess {Topic[]} res Array of filtered topic documents.
1555+
* @apiSuccess {String} topic._id ID of the topic document given by the database.
1556+
*/
1557+
14951558
/**
14961559
* @api {get} /faculty/list Get Faculty List
14971560
* @apiName GetFacultyList
@@ -1530,4 +1593,4 @@
15301593
* @apiSuccess {String[]} faculty.designation Faculty member's designation.
15311594
* @apiSuccess {String} faculty.natureOfAssociation Nature of association with the institution.
15321595
* @apiSuccess {String} faculty.additionalResponsibilities Additional responsibilities of the faculty.
1533-
**/
1596+
**/

0 commit comments

Comments
 (0)