Refactor GetFileByID method to improve readability by removing unnecessary blank lines

This commit is contained in:
Leon Bösche
2026-01-10 02:06:10 +01:00
parent 7f6e7f7a10
commit f86c44224e

View File

@@ -388,17 +388,17 @@ func (db *DB) GetFileByID(ctx context.Context, fileID uuid.UUID) (*File, error)
var f File
var orgNull sql.NullString
var userNull sql.NullString
err := db.QueryRowContext(ctx, `
SELECT id, org_id::text, user_id::text, name, path, type, size, last_modified, created_at
FROM files
WHERE id = $1
`, fileID).Scan(&f.ID, &orgNull, &userNull, &f.Name, &f.Path, &f.Type, &f.Size, &f.LastModified, &f.CreatedAt)
if err != nil {
return nil, err
}
if orgNull.Valid {
oid, _ := uuid.Parse(orgNull.String)
f.OrgID = &oid
@@ -407,7 +407,7 @@ func (db *DB) GetFileByID(ctx context.Context, fileID uuid.UUID) (*File, error)
uid, _ := uuid.Parse(userNull.String)
f.UserID = &uid
}
return &f, nil
}