Skip to content

Commit f176023

Browse files
authored
Merge pull request #112 from TaskTrial/feature/106/delete_team
feature/delete-team
2 parents 2d8f8dc + bdbc720 commit f176023

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/controllers/team.controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,9 +755,9 @@ export const deleteTeamAvatar = async (req, res, next) => {
755755

756756
/**
757757
* @desc Delete team
758-
* @route /api/organization/:organizationId/department/:departmentId/team/:teamId/
758+
* @route /api/organization/:organizationId/department/:departmentId/team/:teamId
759759
* @method DELETE
760-
* @access private - admins or organization owners only
760+
* @access private - admins, organization owners, department managers, or team creators
761761
*/
762762
export const deleteTeam = async (req, res, next) => {
763763
try {
@@ -825,7 +825,7 @@ export const deleteTeam = async (req, res, next) => {
825825
if (!team) {
826826
return res.status(404).json({
827827
success: false,
828-
message: 'Team not found',
828+
message: 'Team not found or already deleted',
829829
});
830830
}
831831

src/docs/swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2291,7 +2291,7 @@
22912291
}
22922292
}
22932293
},
2294-
"/api/organization/{organizationId}/department/{departmentId}/team/{teamId}": {
2294+
"/api/organization/{organizationId}/department/{departmentId}/team/{teamId}/": {
22952295
"delete": {
22962296
"tags": ["Team"],
22972297
"summary": "Delete a team",

src/routes/team.routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ router.delete(
4444
);
4545

4646
router.delete(
47-
'/api/organization/:organizationId/department/:departmentId/team/:teamId/',
47+
'/api/organization/:organizationId/department/:departmentId/team/:teamId',
4848
verifyAccessToken,
4949
deleteTeam,
5050
);

0 commit comments

Comments
 (0)