Chore: Deprecate Id from Folder in DTOs (#77943)
* Chore: Deprecate Id from Folder in DTOs * chore: regen spec
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type Folder struct {
|
||||
// Deprecated: use Uid instead
|
||||
Id int64 `json:"id"`
|
||||
Uid string `json:"uid"`
|
||||
Title string `json:"title"`
|
||||
|
||||
+1
-1
@@ -365,7 +365,7 @@ func (hs *HTTPServer) newToFolderDto(c *contextmodel.ReqContext, f *folder.Folde
|
||||
}
|
||||
|
||||
return dtos.Folder{
|
||||
Id: f.ID,
|
||||
Id: f.ID, // nolint:staticcheck
|
||||
Uid: f.UID,
|
||||
Title: f.Title,
|
||||
Url: f.URL,
|
||||
|
||||
@@ -145,6 +145,7 @@ func TestFoldersCreateAPIEndpoint(t *testing.T) {
|
||||
require.NoError(t, resp.Body.Close())
|
||||
|
||||
if tc.expectedCode == http.StatusOK {
|
||||
// nolint:staticcheck
|
||||
assert.Equal(t, int64(1), folder.Id)
|
||||
assert.Equal(t, "uid", folder.Uid)
|
||||
assert.Equal(t, "Folder", folder.Title)
|
||||
@@ -249,6 +250,7 @@ func TestFoldersUpdateAPIEndpoint(t *testing.T) {
|
||||
require.NoError(t, resp.Body.Close())
|
||||
|
||||
if tc.expectedCode == http.StatusOK {
|
||||
// nolint:staticcheck
|
||||
assert.Equal(t, int64(1), folder.Id)
|
||||
assert.Equal(t, "uid", folder.Uid)
|
||||
assert.Equal(t, "Folder upd", folder.Title)
|
||||
|
||||
Reference in New Issue
Block a user