-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #964 from Aditya3034/feat/delete-milestone
Feat(milestone-card):Added delete functionality
- Loading branch information
Showing
6 changed files
with
142 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* eslint-disable linebreak-style */ | ||
/* eslint-disable object-curly-spacing */ | ||
/* eslint-disable eol-last */ | ||
/* eslint-disable max-len */ | ||
|
||
/** ********************************************************* | ||
* Copyright (C) 2022 | ||
* Worktez | ||
* Author : Aditya Khedekar <aditya3034@gmail.com> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the MIT License | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the MIT License for more details. | ||
***********************************************************/ | ||
|
||
const { getMilestoneData, updateMilestone } = require("../lib"); | ||
|
||
exports.deleteMilestone = function(request, response) { | ||
const milestoneID = request.body.data.MilestoneId; | ||
const orgDomain = request.body.data.OrganizationDomain; | ||
let result; | ||
let status = 200; | ||
|
||
const promise = getMilestoneData(orgDomain, milestoneID).then((mDoc) => { | ||
if (mDoc) { | ||
const updateJson = { | ||
MilestoneStatus: "Deleted", | ||
}; | ||
updateMilestone(updateJson, orgDomain, milestoneID); | ||
result = { data: "Milestone deleted Successfully" }; | ||
console.log("Milestone deleted Successfully"); | ||
} else { | ||
status = 500; | ||
result = { data: "Milestone: Milestone doesn't exist" }; | ||
console.log("Milestone: Milestone doesn't exist"); | ||
} | ||
}).catch((error) => { | ||
status = 500; | ||
console.log("Error: ", error); | ||
}); return Promise.all(promise).then(() => { | ||
return response.status(status).send(result); | ||
}) | ||
.catch((error) => { | ||
result = { data: error }; | ||
console.error("Error deleting Milestone", error); | ||
return response.status(status).send(result); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,7 @@ | |
width:1rem; | ||
height:1rem; | ||
border-radius: 50px; | ||
margin-top: 5px; | ||
} | ||
|
||
.milestone{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters