mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 22:20: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
|
" Edit an issue
|
||||||
" PATCH /repos/:owner/:repo/issues/:number
|
" PATCH /repos/:owner/:repo/issues/:number
|
||||||
function! github#api#issues#Edit(owner,repo,num,user,password,issue) abort
|
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,
|
return github#api#util#Get('repos/' . a:owner . '/' . a:repo . '/issues/' . a:num,
|
||||||
\ ['-X', 'PATCH',
|
\ ['-X', 'PATCH',
|
||||||
\ '-H', 'Accept: application/vnd.github.symmetra-preview+json',
|
\ '-H', 'Accept: application/vnd.github.symmetra-preview+json',
|
||||||
\ '-d', json_encode(a:issue),
|
\ '-d', json_encode(a:issue),
|
||||||
\ '-u', a:user . ':' . a:password])
|
\ '-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
|
endfunction
|
||||||
|
|
||||||
""
|
""
|
||||||
|
Loading…
Reference in New Issue
Block a user