some database code cleanups

This commit is contained in:
2026-03-05 15:47:23 -07:00
parent 1f450dcf14
commit 55c5c88c95
13 changed files with 137 additions and 137 deletions
+3 -3
View File
@@ -60,11 +60,11 @@ func (img *ImageStore) Save(ctx context.Context) error {
* Standard Go error status.
*/
func AmLoadImage(ctx context.Context, id int32) (*ImageStore, error) {
var imgdata ImageStore
if err := amdb.GetContext(ctx, &imgdata, "SELECT * FROM imagestore WHERE imgid = ?", id); err != nil {
imgdata := new(ImageStore)
if err := amdb.GetContext(ctx, imgdata, "SELECT * FROM imagestore WHERE imgid = ?", id); err != nil {
return nil, err
}
return &imgdata, nil
return imgdata, nil
}
/* AmStoreImage stores an image in the database, overwriting one with the same type code and owner if it exists.