Merge pull request #11248 from influxdata/fix/add-orgID-to-proto-at-instantiation

Add the organization ID to the protoboard being instantiated as a dashboard
pull/11256/head
Deniz Kusefoglu 2019-01-17 14:28:06 -08:00 committed by GitHub
commit 4634019354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -112,7 +112,7 @@ func (s *ProtoService) findProto(ctx context.Context, id platform.ID) (*platform
return nil, &platform.Error{Msg: "proto not found"}
}
// CreateDashboardsFromProtos creates instances of each dashboard in a proto.
// CreateDashboardsFromProto creates instances of each dashboard in a proto.
func (s *ProtoService) CreateDashboardsFromProto(ctx context.Context, protoID platform.ID, orgID platform.ID) ([]*platform.Dashboard, error) {
// TODO(desa): this should be done transactionally.
proto, err := s.findProto(ctx, protoID)
@ -125,8 +125,8 @@ func (s *ProtoService) CreateDashboardsFromProto(ctx context.Context, protoID pl
for _, protodash := range proto.Dashboards {
dash := &platform.Dashboard{}
*dash = protodash.Dashboard
// TODO(desa): add organization id here
dash.Cells = nil
dash.OrganizationID = orgID
if err := s.DashboardService.CreateDashboard(ctx, dash); err != nil {
return nil, err