From 93d382f25febc87f4087182d661220460393855d Mon Sep 17 00:00:00 2001 From: Divyaswor Makai Date: Sat, 7 Dec 2024 14:57:08 +0545 Subject: [PATCH] feat: autofill name based on username or let it be empty --- apps/backend/src/api/routes/integrations.controller.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/backend/src/api/routes/integrations.controller.ts b/apps/backend/src/api/routes/integrations.controller.ts index e19e8668..4beb234b 100644 --- a/apps/backend/src/api/routes/integrations.controller.ts +++ b/apps/backend/src/api/routes/integrations.controller.ts @@ -408,9 +408,17 @@ export class IntegrationsController { ); } + let validName = name; + if (!validName) { + if (username) { + validName = username.split('.')[0]; + } else { + validName = ''; + } + } return this._integrationService.createOrUpdateIntegration( org.id, - name, + validName, picture, 'social', String(id),