-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Automatically update MR summary details (#427)
- Loading branch information
1 parent
08d289c
commit a3aa79a
Showing
4 changed files
with
82 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
local job = require("gitlab.job") | ||
local state = require("gitlab.state") | ||
local u = require("gitlab.utils") | ||
|
||
local M = {} | ||
|
||
local refresh_status_state = function(data) | ||
u.notify(data.message, vim.log.levels.INFO) | ||
state.load_new_state("info", function() | ||
require("gitlab.actions.summary").update_summary_details() | ||
end) | ||
end | ||
|
||
M.approve = function() | ||
job.run_job("/mr/approve", "POST") | ||
job.run_job("/mr/approve", "POST", nil, function(data) | ||
refresh_status_state(data) | ||
end) | ||
end | ||
|
||
M.revoke = function() | ||
job.run_job("/mr/revoke", "POST") | ||
job.run_job("/mr/revoke", "POST", nil, function(data) | ||
refresh_status_state(data) | ||
end) | ||
end | ||
|
||
return M |
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