feat: nambahin API assign member, list interns, update profile, serta list projects/tasks

This commit is contained in:
Rafi Athallah
2026-06-08 17:28:37 +07:00
parent f0df564499
commit edc287968d
14 changed files with 1295 additions and 36 deletions
+50
View File
@@ -1,6 +1,8 @@
const express = require('express');
const { authController } = require('../modules/auth');
const { verifyJWT } = require('../middleware/verifyJWT');
const multer = require('../middleware/multer');
const { multerErrorHandler } = require('../middleware/multer');
const router = express.Router();
@@ -92,4 +94,52 @@ router.post("/login", authController.login);
*/
router.get("/me", verifyJWT, authController.me);
/**
* @swagger
* /auth-api/update-profile:
* patch:
* summary: Update authenticated user profile
* description: Update profile details (full name, email, password, professional bio). Admins can also upload a profile picture.
* tags: [Auth]
* security:
* - bearerAuth: []
* requestBody:
* required: true
* content:
* multipart/form-data:
* schema:
* type: object
* properties:
* full_name:
* type: string
* example: "Jonathan Kristina"
* email:
* type: string
* example: "jonathan.kristina@example.com"
* password:
* type: string
* example: "newSecurePassword123"
* professional_bio:
* type: string
* example: "Experienced UI/UX Designer and Engineer"
* profile_picture:
* type: string
* format: binary
* description: Admin only. Optional profile picture upload.
* responses:
* 200:
* description: Profile successfully updated
* 400:
* description: Bad Request (Validation error)
* 401:
* description: Unauthorized
* 403:
* description: Forbidden (Interns uploading images)
* 409:
* description: Conflict (Email already in use)
* 500:
* description: Internal server error
*/
router.patch('/update-profile', verifyJWT, multer.single('profile_picture'), multerErrorHandler, authController.updateProfile);
module.exports = router;