feat: Allow org creation with conflicting slug and renaming team slug during migration (#13065)

This commit is contained in:
Hariom Balhara authored and GitHub committed 2024-01-07 08:51:59 +05:30
1 parent 50fb903ba6
commit 2f1e545976
6 files changed
+121 -41

No files matched your search

@@ -40,7 +40,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
return res.status(400).json({ message: JSON.stringify(parsedBody.error) });
}
const { teamId, targetOrgId, moveMembers } = parsedBody.data;
const { teamId, targetOrgId, moveMembers, teamSlugInOrganization } = parsedBody.data;
const isAllowed = isAdmin;
if (!isAllowed) {
return res.status(403).json({ message: "Not Authorized" });
@@ -48,7 +48,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
try {
await moveTeamToOrg({
targetOrgId,
targetOrg: {
id: targetOrgId,
teamSlug: teamSlugInOrganization,
},
teamId,
moveMembers,
});