@@ -23,7 +23,7 @@ type NodePoolDao interface {
2323 FindByIDs (ctx context.Context , ids []string ) (api.NodePoolList , error )
2424 FindByOwner (ctx context.Context , ownerID string ) (api.NodePoolList , error )
2525 FindSoftDeletedByOwner (ctx context.Context , ownerID string ) (api.NodePoolList , error )
26- SoftDeleteByOwner (ctx context.Context , ownerID string , t time.Time , deletedBy string ) error
26+ SoftDeleteByOwner (ctx context.Context , ownerID string , t time.Time , deletedBy string ) ( int64 , error )
2727 UpdateStatusConditionsByIDs (ctx context.Context , updates map [string ][]byte ) error
2828 ExistsByOwner (ctx context.Context , ownerID string ) (bool , error )
2929 All (ctx context.Context ) (api.NodePoolList , error )
@@ -120,7 +120,9 @@ func (d *sqlNodePoolDao) Delete(ctx context.Context, id string) error {
120120 return nil
121121}
122122
123- func (d * sqlNodePoolDao ) SoftDeleteByOwner (ctx context.Context , ownerID string , t time.Time , deletedBy string ) error {
123+ func (d * sqlNodePoolDao ) SoftDeleteByOwner (
124+ ctx context.Context , ownerID string , t time.Time , deletedBy string ,
125+ ) (int64 , error ) {
124126 g2 := (* d .sessionFactory ).New (ctx )
125127 result := g2 .Model (& api.NodePool {}).
126128 Where ("owner_id = ? AND deleted_time IS NULL" , ownerID ).
@@ -131,9 +133,9 @@ func (d *sqlNodePoolDao) SoftDeleteByOwner(ctx context.Context, ownerID string,
131133 })
132134 if result .Error != nil {
133135 db .MarkForRollback (ctx , result .Error )
134- return result .Error
136+ return 0 , result .Error
135137 }
136- return nil
138+ return result . RowsAffected , nil
137139}
138140
139141func (d * sqlNodePoolDao ) FindSoftDeletedByOwner (ctx context.Context , ownerID string ) (api.NodePoolList , error ) {
0 commit comments