From eec2a8ba8584e1b3121e9b2fda05dc98c77ddf25 Mon Sep 17 00:00:00 2001 From: Zane Helton Date: Sat, 28 Jun 2025 18:10:38 -0400 Subject: [PATCH] Set `premium_tier` to 0 when creating guild from template I think we'll need to discuss the proper way to provide default values here. `premium_tier` for example should never be provided from the template so it's fine going after the spread operator. This commit still doesn't allow guilds to be created from template because the next error is that `welcome_screen` doesn't exist. Our options: 1. Provide default values in the ORM 2. Provide default values in the guild creation process 3. Throw an error if the template is missing values Resolves: #1283 but creates a new issue --- src/api/routes/guilds/templates/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/routes/guilds/templates/index.ts b/src/api/routes/guilds/templates/index.ts index c238b1d1..d6de87f9 100644 --- a/src/api/routes/guilds/templates/index.ts +++ b/src/api/routes/guilds/templates/index.ts @@ -145,6 +145,7 @@ router.post( ...template.serialized_source_guild, id: guild_id, owner_id: req.user_id, + premium_tier: 0, }).save(); await Role.create({