diff --git a/server/src/controllers/projectController.js b/server/src/controllers/projectController.js index 9db07b1..fc34b9d 100644 --- a/server/src/controllers/projectController.js +++ b/server/src/controllers/projectController.js @@ -50,6 +50,7 @@ export const createNewProject = async (req, res) => { await newProject.save(); res.status(201).json({ message: 'Project created successfully.', project: newProject }); } catch (error) { + console.log(error); console.log(error); res.status(500).json({ message: 'Error creating project.' }); } @@ -66,6 +67,8 @@ export const apply = async (req, res) => { console.log(`freelancer = ${freelancerId}`) + console.log(`freelancer = ${freelancerId}`) + const freelancer = await User.findById(freelancerId); if (!freelancer) return res.status(404).json({ message: 'Freelancer not found.' }); diff --git a/server/src/controllers/userController.js b/server/src/controllers/userController.js deleted file mode 100644 index 366c895..0000000 --- a/server/src/controllers/userController.js +++ /dev/null @@ -1 +0,0 @@ -// Handles user-related actions (registration, login). \ No newline at end of file diff --git a/server/src/models/projectModel.js b/server/src/models/projectModel.js index 5b0020f..27adac5 100644 --- a/server/src/models/projectModel.js +++ b/server/src/models/projectModel.js @@ -14,8 +14,8 @@ const projectSchema = new mongoose.Schema({ type: String, required: true }, - deadline: { - type: Date, + deadline: { // problem + type: Number, required: true }, applicationDate: { diff --git a/server/src/routes/contributionRoutes.js b/server/src/routes/contributionRoutes.js deleted file mode 100644 index 73b835c..0000000 --- a/server/src/routes/contributionRoutes.js +++ /dev/null @@ -1,23 +0,0 @@ -// import express from 'express'; -// import { -// approveContribution, -// submitPullRequest, -// checkContributionStatus, -// getContributionsForProject, -// } from '../controllers/contributionController.js'; - -// const router = express.Router(); - -// // Route to get contributions for a specific project -// router.get('/project/:projectId', getContributionsForProject); - -// // Route to approve a contribution -// router.post('/:projectId/:contributionId/approve', approveContribution); - -// // Route to submit a PR for a contribution -// router.post('/:contributionId/submit-pr', submitPullRequest); - -// // Route to check the contribution status (e.g., PR merged or not) -// router.get('/:contributionId/check-status', checkContributionStatus); - -// export default router;