Skip to content

Commit 0c5cfc3

Browse files
Add return ID to CRUD tools (#1074)
* add return ID to crud tools * Update pkg/github/gists.go Co-authored-by: Copilot <[email protected]> * Update pkg/github/gists.go Co-authored-by: Copilot <[email protected]> * fix gist id to string conv --------- Co-authored-by: Copilot <[email protected]>
1 parent 9db2e17 commit 0c5cfc3

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

pkg/github/gists.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ func CreateGist(getClient GetClientFn, t translations.TranslationHelperFunc) (to
166166
}
167167

168168
minimalResponse := MinimalResponse{
169+
ID: createdGist.GetID(),
169170
URL: createdGist.GetHTMLURL(),
170171
}
171172

@@ -254,6 +255,7 @@ func UpdateGist(getClient GetClientFn, t translations.TranslationHelperFunc) (to
254255
}
255256

256257
minimalResponse := MinimalResponse{
258+
ID: updatedGist.GetID(),
257259
URL: updatedGist.GetHTMLURL(),
258260
}
259261

pkg/github/issues.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,7 @@ func CreateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t
874874

875875
// Return minimal response with just essential information
876876
minimalResponse := MinimalResponse{
877+
ID: fmt.Sprintf("%d", issue.GetID()),
877878
URL: issue.GetHTMLURL(),
878879
}
879880

@@ -1249,6 +1250,7 @@ func UpdateIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t
12491250

12501251
// Return minimal response with just essential information
12511252
minimalResponse := MinimalResponse{
1253+
ID: fmt.Sprintf("%d", updatedIssue.GetID()),
12521254
URL: updatedIssue.GetHTMLURL(),
12531255
}
12541256

pkg/github/minimal_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ type MinimalBranch struct {
110110
// Success is implicit in the HTTP response status, and all other information
111111
// can be derived from the URL or fetched separately if needed.
112112
type MinimalResponse struct {
113+
ID string `json:"id"`
113114
URL string `json:"url"`
114115
}
115116

pkg/github/pullrequests.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ func CreatePullRequest(getClient GetClientFn, t translations.TranslationHelperFu
195195

196196
// Return minimal response with just essential information
197197
minimalResponse := MinimalResponse{
198+
ID: fmt.Sprintf("%d", pr.GetID()),
198199
URL: pr.GetHTMLURL(),
199200
}
200201

@@ -471,6 +472,7 @@ func UpdatePullRequest(getClient GetClientFn, getGQLClient GetGQLClientFn, t tra
471472

472473
// Return minimal response with just essential information
473474
minimalResponse := MinimalResponse{
475+
ID: fmt.Sprintf("%d", finalPR.GetID()),
474476
URL: finalPR.GetHTMLURL(),
475477
}
476478

pkg/github/repositories.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ func CreateRepository(getClient GetClientFn, t translations.TranslationHelperFun
468468

469469
// Return minimal response with just essential information
470470
minimalResponse := MinimalResponse{
471+
ID: fmt.Sprintf("%d", createdRepo.GetID()),
471472
URL: createdRepo.GetHTMLURL(),
472473
}
473474

@@ -744,6 +745,7 @@ func ForkRepository(getClient GetClientFn, t translations.TranslationHelperFunc)
744745

745746
// Return minimal response with just essential information
746747
minimalResponse := MinimalResponse{
748+
ID: fmt.Sprintf("%d", forkedRepo.GetID()),
747749
URL: forkedRepo.GetHTMLURL(),
748750
}
749751

0 commit comments

Comments
 (0)