mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
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:
@@ -128,6 +128,20 @@ class MockProjectHistoryApi extends AbstractMockApi {
|
||||
}
|
||||
)
|
||||
|
||||
this.app.delete('/project/:projectId/labels/:labelId', (req, res) => {
|
||||
const { projectId, labelId } = req.params
|
||||
const label =
|
||||
this.labels[projectId] != null
|
||||
? this.labels[projectId][labelId]
|
||||
: undefined
|
||||
if (label != null) {
|
||||
this.deleteLabel(projectId, labelId)
|
||||
res.sendStatus(204)
|
||||
} else {
|
||||
res.sendStatus(404)
|
||||
}
|
||||
})
|
||||
|
||||
this.app.post('/project/:projectId/flush', (req, res) => {
|
||||
res.sendStatus(200)
|
||||
})
|
||||
|
||||
@@ -38,6 +38,7 @@ describe('HistoryController', function () {
|
||||
'../Project/ProjectEntityUpdateHandler':
|
||||
(this.ProjectEntityUpdateHandler = {}),
|
||||
'../User/UserGetter': (this.UserGetter = {}),
|
||||
'../Project/ProjectGetter': (this.ProjectGetter = {}),
|
||||
'./RestoreManager': (this.RestoreManager = {}),
|
||||
'../../infrastructure/Features': (this.Features = sinon
|
||||
.stub()
|
||||
|
||||
Reference in New Issue
Block a user