mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Fixing bug where non-updated query object is returned (#361)
This commit is contained in:
parent
4f83220870
commit
c5339ddb76
1 changed files with 3 additions and 3 deletions
|
|
@ -14,7 +14,7 @@ func (svc service) GetQuery(ctx context.Context, id uint) (*kolide.Query, error)
|
|||
}
|
||||
|
||||
func (svc service) NewQuery(ctx context.Context, p kolide.QueryPayload) (*kolide.Query, error) {
|
||||
var query kolide.Query
|
||||
query := &kolide.Query{}
|
||||
|
||||
if p.Name != nil {
|
||||
query.Name = *p.Name
|
||||
|
|
@ -48,11 +48,11 @@ func (svc service) NewQuery(ctx context.Context, p kolide.QueryPayload) (*kolide
|
|||
query.Version = *p.Version
|
||||
}
|
||||
|
||||
_, err := svc.ds.NewQuery(&query)
|
||||
query, err := svc.ds.NewQuery(query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &query, nil
|
||||
return query, nil
|
||||
}
|
||||
|
||||
func (svc service) ModifyQuery(ctx context.Context, id uint, p kolide.QueryPayload) (*kolide.Query, error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue