Skip to content

Commit

Permalink
Return ID when datasource is created (#5406)
Browse files Browse the repository at this point in the history
  • Loading branch information
eleftherias authored Feb 5, 2025
1 parent 15f65ba commit bc651b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/datasources/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ func (d *dataSourceService) Create(
return nil, fmt.Errorf("failed to commit transaction: %w", err)
}

ds.Id = dsRecord.ID.String()

return ds, nil
}

Expand Down
1 change: 1 addition & 0 deletions internal/datasources/service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ func TestCreate(t *testing.T) {

require.NoError(t, err)
assert.Equal(t, tt.want.Name, got.Name)
assert.NotEmpty(t, got.Id)
})
}
}
Expand Down

0 comments on commit bc651b1

Please sign in to comment.