fix: Return own and other sources better

This commit is contained in:
Andras Bacsai 2022-04-10 00:31:10 +02:00
parent 7953c1df30
commit bb0c93dc2f

View File

@ -46,15 +46,12 @@
(source.type === 'github' && source.githubAppId && source.githubApp.installationId) || (source.type === 'github' && source.githubAppId && source.githubApp.installationId) ||
(source.type === 'gitlab' && source.gitlabAppId) (source.type === 'gitlab' && source.gitlabAppId)
); );
console.log(filteredSources);
const ownSources = filteredSources.filter((source) => { const ownSources = filteredSources.filter((source) => {
if (source.teams[0].id === $session.teamId) { return source.teams.filter((team) => team.id === $session.teamId);
return source;
}
}); });
const otherSources = filteredSources.filter((source) => { const otherSources = filteredSources.filter((source) => {
if (source.teams[0].id !== $session.teamId) { return source.teams.filter((team) => team.id !== $session.teamId);
return source;
}
}); });
async function handleSubmit(gitSourceId) { async function handleSubmit(gitSourceId) {