Skip to content

Commit

Permalink
fix: be more explicit about matching just one record
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeg committed Apr 25, 2024
1 parent 43621ae commit deb58f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/identity/CollaboratorsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,15 @@ class CollaboratorsService {
AND repos.deleted_at IS NULL
AND sites.deleted_at IS NULL
AND users.deleted_at IS NULL
LIMI 1
`,
{
replacements: { siteName, userId },
type: QueryTypes.SELECT,
}
)) as { role: CollaboratorRoles }[]

if (records.length > 0) {
if (records.length === 1) {
return records[0].role
}

Expand Down

0 comments on commit deb58f5

Please sign in to comment.