瀏覽代碼

Add default prefix for Metronome customer (#4505)

Mauricio Araujo 2 年之前
父節點
當前提交
837c06ec1b
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      internal/billing/metronome.go

+ 6 - 1
internal/billing/metronome.go

@@ -43,8 +43,13 @@ func (m MetronomeClient) createCustomer(ctx context.Context, orgName string, pro
 	path := "customers"
 	path := "customers"
 	projIDStr := strconv.FormatUint(uint64(projectID), 10)
 	projIDStr := strconv.FormatUint(uint64(projectID), 10)
 
 
+	prefix := "Project"
+	if orgName != "" {
+		prefix = orgName
+	}
+
 	customer := types.Customer{
 	customer := types.Customer{
-		Name: fmt.Sprintf("%s - %s", orgName, projectName),
+		Name: fmt.Sprintf("%s - %s", prefix, projectName),
 		Aliases: []string{
 		Aliases: []string{
 			projIDStr,
 			projIDStr,
 		},
 		},