Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(teams): only set is_paying if subscription id is provided (#5078)

Will Hutchinson98f3f55119ae
diff --git a/.sqlx/query-05f7a9a439044165e4523a2b25261b11f805ba2dcf3f0b0a03422502ee73f304.json b/.sqlx/query-3077b37e938c3d4c03d3a555a2bafbee6ca8ad05a9fca54736aeb6fc19409002.json
similarity index 81%
rename from .sqlx/query-05f7a9a439044165e4523a2b25261b11f805ba2dcf3f0b0a03422502ee73f304.json
rename to .sqlx/query-3077b37e938c3d4c03d3a555a2bafbee6ca8ad05a9fca54736aeb6fc19409002.json
index c4591d50a4..842118de4f 100644
--- a/.sqlx/query-05f7a9a439044165e4523a2b25261b11f805ba2dcf3f0b0a03422502ee73f304.json
+++ b/.sqlx/query-3077b37e938c3d4c03d3a555a2bafbee6ca8ad05a9fca54736aeb6fc19409002.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n INSERT INTO team (id, name, owner_id, seat_count, subscription_id, paying)\n VALUES ($1, $2, $3, 1, $4, TRUE)\n RETURNING id, name, slug, owner_id, enterprise, allow_non_admin_invites\n ",
+ "query": "\n INSERT INTO team (id, name, owner_id, seat_count, subscription_id, paying)\n VALUES ($1, $2, $3, 1, $4, $5)\n RETURNING id, name, slug, owner_id, enterprise, allow_non_admin_invites\n ",
"describe": {
"columns": [
{
@@ -39,7 +39,8 @@
"Uuid",
"Text",
"Text",
- "Text"
+ "Text",
+ "Bool"
]
},
"nullable": [
@@ -51,5 +52,5 @@
false
]
},
- "hash": "05f7a9a439044165e4523a2b25261b11f805ba2dcf3f0b0a03422502ee73f304"
+ "hash": "3077b37e938c3d4c03d3a555a2bafbee6ca8ad05a9fca54736aeb6fc19409002"
}
diff --git a/crates/teams/src/outbound/team_repo.rs b/crates/teams/src/outbound/team_repo.rs
index 082a33165b..d2c2ebdf31 100644
--- a/crates/teams/src/outbound/team_repo.rs
+++ b/crates/teams/src/outbound/team_repo.rs
@@ -147,13 +147,14 @@ impl TeamRepositoryImpl {
let team = sqlx::query!(
r#"
INSERT INTO team (id, name, owner_id, seat_count, subscription_id, paying)
- VALUES ($1, $2, $3, 1, $4, TRUE)
+ VALUES ($1, $2, $3, 1, $4, $5)
RETURNING id, name, slug, owner_id, enterprise, allow_non_admin_invites
"#,
id,
team_name,
user_id.as_ref(),
subscription_id.map(|s| s.to_string()),
+ subscription_id.is_some(),
)
.try_map(|row| {
Ok(Team {