Merge pull request #474 from divyaswormakai/feat-autofill-name

feat: autofill name based on username or let it be random string
This commit is contained in:
James Read 2024-12-08 22:35:27 +00:00 committed by GitHub
commit f8486e61a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 1 deletions

View File

@ -441,9 +441,17 @@ export class IntegrationsController {
);
}
let validName = name;
if (!validName) {
if (username) {
validName = username.split('.')[0] ?? username;
} else {
validName = `Channel_${String(id).slice(0, 8)}`;
}
}
return this._integrationService.createOrUpdateIntegration(
org.id,
name,
validName.trim(),
picture,
'social',
String(id),