Skip to content

Commit f8486e6

Browse files
authored
Merge pull request #474 from divyaswormakai/feat-autofill-name
feat: autofill name based on username or let it be random string
2 parents d07ed2b + 515ff8a commit f8486e6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

apps/backend/src/api/routes/integrations.controller.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,17 @@ export class IntegrationsController {
441441
);
442442
}
443443

444+
let validName = name;
445+
if (!validName) {
446+
if (username) {
447+
validName = username.split('.')[0] ?? username;
448+
} else {
449+
validName = `Channel_${String(id).slice(0, 8)}`;
450+
}
451+
}
444452
return this._integrationService.createOrUpdateIntegration(
445453
org.id,
446-
name,
454+
validName.trim(),
447455
picture,
448456
'social',
449457
String(id),

0 commit comments

Comments
 (0)