Undo changes to getObject calls in sql

This commit is contained in:
Andreas Marschke 2024-01-10 07:14:12 +01:00
parent 7e0d5648d1
commit d09f416423
3 changed files with 2 additions and 11 deletions

View File

@ -1,4 +1,3 @@
package sql package sql
import ( import (

View File

@ -6,13 +6,7 @@ import (
) )
func (d *SqlDb) GetAccessKey(projectID int, accessKeyID int) (key db.AccessKey, err error) { func (d *SqlDb) GetAccessKey(projectID int, accessKeyID int) (key db.AccessKey, err error) {
var keyObj interface{} err = d.getObject(projectID, db.AccessKeyProps, accessKeyID, &key)
keyObj, err = d.GetObject(db.AccessKeyProps, accessKeyID)
key = keyObj.(db.AccessKey)
if err != nil {
return
}
return return
} }

View File

@ -3,9 +3,7 @@ package sql
import "github.com/ansible-semaphore/semaphore/db" import "github.com/ansible-semaphore/semaphore/db"
func (d *SqlDb) GetInventory(projectID int, inventoryID int) (inventory db.Inventory, err error) { func (d *SqlDb) GetInventory(projectID int, inventoryID int) (inventory db.Inventory, err error) {
var invObj interface{} err = d.getObject(projectID, db.InventoryProps, inventoryID, &inventory)
invObj, err = d.GetObject(db.InventoryProps, inventoryID)
inventory = invObj.(db.Inventory)
if err != nil { if err != nil {
return return
} }