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
import (

View File

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

View File

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