Added ability to remove timelogs
What does this MR do and why?
This MR adds the possibility to delete a timelog using a GraphQL mutation.
Only the user who added the timelog and maintainers of the project can actually delete it, all the other users will get an unauthorized error.
Screenshots or screen recordings
How to set up and validate locally
- Add a timelog to either an issue or a merge request
- Try to delete the timelog entry using the new
timelogDelete
mutation from the GraphiQL explorermutation { deleteTimelog(input: { id: "gid://gitlab/Timelog/7" }) { timelog { id timeSpent spentAt summary } errors } }
- If the logged in user is the one who added the timelog (or a maintainer of the project) the request will succeed returning the informations of the deleted timelog
- Otherwise the request will fail providing an unauthorized error message
- If the timelog for the provided id doesn't exist the request fails with the appropriate error message
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Marco Zille