فهرست منبع

add feature flag to projects for preview envs

Alexander Belanger 4 سال پیش
والد
کامیت
d858ce5331
2فایلهای تغییر یافته به همراه10 افزوده شده و 6 حذف شده
  1. 4 3
      api/types/project.go
  2. 6 3
      internal/models/project.go

+ 4 - 3
api/types/project.go

@@ -1,9 +1,10 @@
 package types
 
 type Project struct {
-	ID    uint    `json:"id"`
-	Name  string  `json:"name"`
-	Roles []*Role `json:"roles"`
+	ID                 uint    `json:"id"`
+	Name               string  `json:"name"`
+	Roles              []*Role `json:"roles"`
+	PreviewEnvsEnabled bool    `json:"preview_envs_enabled"`
 }
 
 type CreateProjectRequest struct {

+ 6 - 3
internal/models/project.go

@@ -52,6 +52,8 @@ type Project struct {
 	OAuthIntegrations []ints.OAuthIntegration `json:"oauth_integrations"`
 	AWSIntegrations   []ints.AWSIntegration   `json:"aws_integrations"`
 	GCPIntegrations   []ints.GCPIntegration   `json:"gcp_integrations"`
+
+	PreviewEnvsEnabled bool
 }
 
 // ToProjectType generates an external types.Project to be shared over REST
@@ -63,8 +65,9 @@ func (p *Project) ToProjectType() *types.Project {
 	}
 
 	return &types.Project{
-		ID:    p.ID,
-		Name:  p.Name,
-		Roles: roles,
+		ID:                 p.ID,
+		Name:               p.Name,
+		Roles:              roles,
+		PreviewEnvsEnabled: p.PreviewEnvsEnabled,
 	}
 }