mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 07:10:06 +08:00
feat(github.vim): update issue_edit function
This commit is contained in:
parent
b30894369c
commit
c4e7b5c744
@ -123,11 +123,19 @@ endfunction
|
||||
" Edit an issue
|
||||
" PATCH /repos/:owner/:repo/issues/:number
|
||||
function! github#api#issues#Edit(owner,repo,num,user,password,issue) abort
|
||||
if empty(a:password) || empty(a:user)
|
||||
return github#api#util#Get('repos/' . a:owner . '/' . a:repo . '/issues/' . a:num,
|
||||
\ ['-X', 'PATCH',
|
||||
\ '-H', 'Accept: application/vnd.github.symmetra-preview+json',
|
||||
\ '-d', json_encode(a:issue),
|
||||
\ '-u', a:user . ':' . a:password])
|
||||
else
|
||||
return github#api#util#Get('repos/' . a:owner . '/' . a:repo . '/issues/' . a:num,
|
||||
\ ['-X', 'PATCH',
|
||||
\ '-H', 'Accept: application/vnd.github.symmetra-preview+json',
|
||||
\ '-d', json_encode(a:issue)
|
||||
\ ] + github#api#authorize())
|
||||
endif
|
||||
endfunction
|
||||
|
||||
""
|
||||
|
Loading…
Reference in New Issue
Block a user