Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CAL-542] Can't create a team (Team name already taken) #5891

Closed
ciaranha opened this issue Dec 6, 2022 · 4 comments · Fixed by #5911
Closed

[CAL-542] Can't create a team (Team name already taken) #5891

ciaranha opened this issue Dec 6, 2022 · 4 comments · Fixed by #5911
Assignees
Labels
🐛 bug Something isn't working High priority Created by Linear-GitHub Sync

Comments

@ciaranha
Copy link
Member

ciaranha commented Dec 6, 2022

No matter what team name I choose, it says "Team name already taken".

It can't be possible that all these team names are taken?

53bae159-1d7a-4093-b480-e15c0f279414

Also, from a UI perspective we should use our inline banner for errors.

From SyncLinear.com | CAL-542

@ciaranha ciaranha self-assigned this Dec 6, 2022
@ciaranha ciaranha added High priority Created by Linear-GitHub Sync 🐛 bug Something isn't working labels Dec 6, 2022
@ciaranha ciaranha changed the title [CAL-542] Can't create a team [CAL-542] Can't create a team (Team name already taken) Dec 6, 2022
@PeerRich
Copy link
Member

PeerRich commented Dec 6, 2022

oh maybe its the name? "Product" that is being used to check for conflict? If yes, then thats bad. the slug should be unique, not the name

@PeerRich
Copy link
Member

PeerRich commented Dec 6, 2022

@Udit-takkar can you investigate?

@sumedh1996
Copy link
Contributor

sumedh1996 commented Dec 7, 2022

@PeerRich @Udit-takkar
i looked into this issue and found the problem with the nameCollisions in teams.tsx

const nameCollisions = await ctx.prisma.team.findFirst({ where: {OR: [{ name }, { slug }] }, });

Here we are using OR operator with name and slug and there is a document with name: Product
{
id: 9,
name: 'Product',
slug: null,
logo: null,
bio: null,
hideBranding: false,
createdAt: 2022-12-07T08:48:11.225Z,
metadata: { requestedSlug: 'product-csac-sakjdnasjkndsndknda' }
}

@PeerRich
Copy link
Member

PeerRich commented Dec 7, 2022

@PeerRich @Udit-takkar

i looked into this issue and found the problem with the nameCollisions in teams.tsx

` const nameCollisions = await ctx.prisma.team.findFirst({

    where: {OR: [{ name }, { slug }] },

  });`

Here we are using OR operator with name and slug and there is a document with name: Product

{

id: 9,

name: 'Product',

slug: null,

logo: null,

bio: null,

hideBranding: false,

createdAt: 2022-12-07T08:48:11.225Z,

metadata: { requestedSlug: 'product-csac-sakjdnasjkndsndknda' }

}

great find -- it should be slug only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working High priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants