Update plugins/sangmata.js
Browse files- plugins/sangmata.js +3 -7
plugins/sangmata.js
CHANGED
@@ -11,8 +11,6 @@ const SangmataRoutes = express.Router();
|
|
11 |
* summary: Track and update a user's first name history
|
12 |
* tags: [Sangmata]
|
13 |
* description: Updates or creates a record tracking a user's first name changes.
|
14 |
-
* security:
|
15 |
-
* - apiKeyAuth: []
|
16 |
* requestBody:
|
17 |
* required: true
|
18 |
* content:
|
@@ -72,7 +70,7 @@ const SangmataRoutes = express.Router();
|
|
72 |
* 500:
|
73 |
* description: Internal server error.
|
74 |
*/
|
75 |
-
SangmataRoutes.post("/api/v2/sangmata/tracker", authenticateApiKey, async (req, res) => {
|
76 |
try {
|
77 |
const { user_id, username, first_name } = req.body;
|
78 |
|
@@ -106,9 +104,7 @@ SangmataRoutes.post("/api/v2/sangmata/tracker", authenticateApiKey, async (req,
|
|
106 |
* summary: Retrieve a user's first name history
|
107 |
* tags: [Sangmata]
|
108 |
* description: Fetches the historical first names and latest username of a tracked user.
|
109 |
-
*
|
110 |
-
* - apiKeyAuth: []
|
111 |
-
* parameters:
|
112 |
* - in: header
|
113 |
* name: x-api-key
|
114 |
* required: true
|
@@ -146,7 +142,7 @@ SangmataRoutes.post("/api/v2/sangmata/tracker", authenticateApiKey, async (req,
|
|
146 |
* 500:
|
147 |
* description: Internal server error.
|
148 |
*/
|
149 |
-
SangmataRoutes.get("/api/v2/sangmata/tracker/:user_id", authenticateApiKey, async (req, res) => {
|
150 |
try {
|
151 |
const { user_id } = req.params;
|
152 |
const user = await SangMata.findOne({ user_id });
|
|
|
11 |
* summary: Track and update a user's first name history
|
12 |
* tags: [Sangmata]
|
13 |
* description: Updates or creates a record tracking a user's first name changes.
|
|
|
|
|
14 |
* requestBody:
|
15 |
* required: true
|
16 |
* content:
|
|
|
70 |
* 500:
|
71 |
* description: Internal server error.
|
72 |
*/
|
73 |
+
SangmataRoutes.post("/api/v2/sangmata/tracker", authenticateApiKey, apiLimiter, async (req, res) => {
|
74 |
try {
|
75 |
const { user_id, username, first_name } = req.body;
|
76 |
|
|
|
104 |
* summary: Retrieve a user's first name history
|
105 |
* tags: [Sangmata]
|
106 |
* description: Fetches the historical first names and latest username of a tracked user.
|
107 |
+
* path:
|
|
|
|
|
108 |
* - in: header
|
109 |
* name: x-api-key
|
110 |
* required: true
|
|
|
142 |
* 500:
|
143 |
* description: Internal server error.
|
144 |
*/
|
145 |
+
SangmataRoutes.get("/api/v2/sangmata/tracker/:user_id", authenticateApiKey, apiLimiter, async (req, res) => {
|
146 |
try {
|
147 |
const { user_id } = req.params;
|
148 |
const user = await SangMata.findOne({ user_id });
|