Chore: Deprecate FolderID in LibraryElement struct (#77377)

* Chore: Deprecate FolderID in LibraryElement struct

* chore: format deprecated comment

* chore: add remaining nolint comments
This commit is contained in:
Kat Yang 2023-10-31 13:02:53 -04:00 committed by GitHub
parent 13c0268d6b
commit f9b21083c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -147,7 +147,7 @@ func (l *LibraryElementService) createLibraryElement(c context.Context, signedIn
element := model.LibraryElement{
OrgID: signedInUser.GetOrgID(),
FolderID: cmd.FolderID,
FolderID: cmd.FolderID, // nolint:staticcheck
UID: createUID,
Name: cmd.Name,
Model: updatedModel,
@ -191,7 +191,7 @@ func (l *LibraryElementService) createLibraryElement(c context.Context, signedIn
dto := model.LibraryElementDTO{
ID: element.ID,
OrgID: element.OrgID,
FolderID: element.FolderID,
FolderID: element.FolderID, // nolint:staticcheck
UID: element.UID,
Name: element.Name,
Kind: element.Kind,
@ -524,7 +524,7 @@ func (l *LibraryElementService) handleFolderIDPatches(ctx context.Context, eleme
if err := l.requireEditPermissionsOnFolder(ctx, user, fromFolderID); err != nil {
return err
}
// nolint:staticcheck
elementToPatch.FolderID = toFolderID
return nil
@ -574,7 +574,7 @@ func (l *LibraryElementService) patchLibraryElement(c context.Context, signedInU
var libraryElement = model.LibraryElement{
ID: elementInDB.ID,
OrgID: signedInUser.GetOrgID(),
FolderID: cmd.FolderID,
FolderID: cmd.FolderID, // nolint:staticcheck
UID: updateUID,
Name: cmd.Name,
Kind: elementInDB.Kind,
@ -613,7 +613,7 @@ func (l *LibraryElementService) patchLibraryElement(c context.Context, signedInU
dto = model.LibraryElementDTO{
ID: libraryElement.ID,
OrgID: libraryElement.OrgID,
FolderID: libraryElement.FolderID,
FolderID: libraryElement.FolderID, // nolint:staticcheck
UID: libraryElement.UID,
Name: libraryElement.Name,
Kind: libraryElement.Kind,

View File

@ -20,8 +20,9 @@ const (
// LibraryElement is the model for library element definitions.
type LibraryElement struct {
ID int64 `xorm:"pk autoincr 'id'"`
OrgID int64 `xorm:"org_id"`
ID int64 `xorm:"pk autoincr 'id'"`
OrgID int64 `xorm:"org_id"`
// Deprecated: use FolderUID instead
FolderID int64 `xorm:"folder_id"`
UID string `xorm:"uid"`
Name string