Fix error message (#4559)

This commit is contained in:
Mike
2025-04-23 01:28:15 +02:00
committed by GitHub
parent 45d20f13d2
commit 6cc916b210
2 changed files with 4 additions and 5 deletions
@@ -1167,10 +1167,9 @@ export const revokeStreamPermissionsFactory =
.count<{ count: string }[]>()
if (parseInt(streamAclEntriesCount.count) === 1)
throw new StreamAccessUpdateError(
'Stream has only one ownership link left - cannot revoke permissions.',
{ info: { streamId, userId } }
)
throw new StreamAccessUpdateError('A project needs at least one project owner', {
info: { streamId, userId }
})
const aclEntry = existingPermission
if (aclEntry?.role === Roles.Stream.Owner) {
@@ -348,7 +348,7 @@ describe('Streams @core-streams', () => {
throw new Error('This should have thrown')
})
.catch((err) => {
expect(err.message).to.include('cannot revoke permissions.')
expect(err.message).to.include('A project needs at least one project owner')
})
})