Skip to content

Commit

Permalink
adding deleteProject, updateProject function to other project part
Browse files Browse the repository at this point in the history
  • Loading branch information
Reem-Kamal-Ghoniem committed Feb 11, 2024
1 parent 7c4aec6 commit fdb57f1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/controllers/projectController.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export const createProject = async (req, res) => {
}
};

export const updateProject = async (req, res) => {};
export const updateProject = async (req, res) => {
const { projectID, newName } = req.body;
res.send(await updateProject(projectID, newName));
};
export const joinProject = async (req, res) => {
const uuid = req.body.uuid;
const project = await projectModel.getProjectUUID(uuid);
Expand All @@ -48,7 +51,11 @@ export const joinProject = async (req, res) => {
}
};

export const deleteProject = async (req, res) => {};
export const deleteProject = async (req, res) => {
const { projectID } = req.body;
await deleteProject(projectID);
res.send('project deleted');
};

export const listProjects = async (req, res) => {
const activeTeam = req.body.teamId;
Expand Down

0 comments on commit fdb57f1

Please sign in to comment.