Return responseText
instead of string in some functions (#28836)
Follow https://github.com/go-gitea/gitea/pull/28796#issuecomment-1891727591
This commit is contained in:
parent
4674aea25b
commit
b60a7c3358
8 changed files with 18 additions and 30 deletions
|
@ -14,16 +14,12 @@ type GenerateTokenRequest struct {
|
|||
}
|
||||
|
||||
// GenerateActionsRunnerToken calls the internal GenerateActionsRunnerToken function
|
||||
func GenerateActionsRunnerToken(ctx context.Context, scope string) (string, ResponseExtra) {
|
||||
func GenerateActionsRunnerToken(ctx context.Context, scope string) (*ResponseText, ResponseExtra) {
|
||||
reqURL := setting.LocalURL + "api/internal/actions/generate_actions_runner_token"
|
||||
|
||||
req := newInternalRequest(ctx, reqURL, "POST", GenerateTokenRequest{
|
||||
Scope: scope,
|
||||
})
|
||||
|
||||
resp, extra := requestJSONResp(req, &responseText{})
|
||||
if extra.HasError() {
|
||||
return "", extra
|
||||
}
|
||||
return resp.Text, extra
|
||||
return requestJSONResp(req, &ResponseText{})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue