mirror of
https://github.com/bubblecup-12/VogelSocialMedia.git
synced 2025-07-12 22:18:49 +00:00
added endpoint for getting postTags and fixed follow bug
This commit is contained in:
parent
f035635df2
commit
b868bdb599
8 changed files with 92 additions and 14 deletions
|
@ -1,6 +1,7 @@
|
|||
import express from "express";
|
||||
import {
|
||||
getPost,
|
||||
getTags,
|
||||
getUserPosts,
|
||||
like,
|
||||
removeLike,
|
||||
|
@ -156,4 +157,29 @@ router.post("/like/:postId", authenticateToken(), like);
|
|||
*/
|
||||
router.delete("/removeLike/:postId", authenticateToken(), removeLike);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/posts/tags:
|
||||
* get:
|
||||
* summary: Get posttags
|
||||
* description: Returns posttags
|
||||
* tags:
|
||||
* - Posts
|
||||
* responses:
|
||||
* 200:
|
||||
* description: List of tags
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* tags:
|
||||
* type: array
|
||||
* items:
|
||||
* type: string
|
||||
* 500:
|
||||
* description: Server error
|
||||
*/
|
||||
router.get("/tags", getTags);
|
||||
|
||||
export default router;
|
||||
|
|
|
@ -8,7 +8,7 @@ import {
|
|||
} from "../controllers/profileController";
|
||||
const profileRouter = express.Router();
|
||||
import { upload } from "../middleware/uploadSingle";
|
||||
import { updateBioSchema } from "../schemas/feedSchemas";
|
||||
import { updateBioSchema } from "../schemas/profileSchemas";
|
||||
import { validateData } from "../middleware/validationMiddleware";
|
||||
/**
|
||||
* @swagger
|
||||
|
@ -97,7 +97,7 @@ profileRouter.get("/getProfilePicture/:username", getProfilePicture);
|
|||
* 401:
|
||||
* description: Unauthorized
|
||||
*/
|
||||
profileRouter.post(
|
||||
profileRouter.put(
|
||||
"/updateBio",
|
||||
authenticateToken(),
|
||||
validateData(updateBioSchema),
|
||||
|
@ -105,7 +105,7 @@ profileRouter.post(
|
|||
);
|
||||
/**
|
||||
* @swagger
|
||||
* /api/profile/get/{username}:
|
||||
* /api/profile/{username}:
|
||||
* get:
|
||||
* summary: Get user data
|
||||
* tags: [Profile]
|
||||
|
@ -124,5 +124,5 @@ profileRouter.post(
|
|||
* 401:
|
||||
* description: Ungültige Anmeldedaten
|
||||
*/
|
||||
profileRouter.get("/get/:username", getProfile);
|
||||
profileRouter.get("/:username", getProfile);
|
||||
export default profileRouter;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue