Merge pull request #16545 from overleaf/dp-project-owner-delete-labels

Allow project owners to delete history labels

GitOrigin-RevId: 16111337681ac4085db2cf48e9d4c2fa87993b77
This commit is contained in:
David
2024-01-23 09:03:08 +00:00
committed by Copybot
parent 4683cad1cb
commit e3513a9d50
11 changed files with 198 additions and 15 deletions
@@ -379,13 +379,29 @@ export function createLabel(req, res, next) {
)
}
export function deleteLabel(req, res, next) {
/**
* This will delete a label if it is owned by the current user. If you wish to
* delete a label regardless of the current user, then use `deleteLabel` instead.
*/
export function deleteLabelForUser(req, res, next) {
const {
project_id: projectId,
user_id: userId,
label_id: labelId,
} = req.params
LabelsManager.deleteLabel(projectId, userId, labelId, error => {
LabelsManager.deleteLabelForUser(projectId, userId, labelId, error => {
if (error != null) {
return next(error)
}
res.sendStatus(204)
})
}
export function deleteLabel(req, res, next) {
const { project_id: projectId, label_id: labelId } = req.params
LabelsManager.deleteLabel(projectId, labelId, error => {
if (error != null) {
return next(error)
}