Update groups CRUD SCIM to use orgMembershipId

This commit is contained in:
Tuan Dang
2024-04-28 21:58:24 -07:00
parent a7af3a48d9
commit b2a976f3d4
9 changed files with 120 additions and 131 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import { alphaNumericNanoId } from "@app/lib/nanoid";
import { TUserDALFactory } from "@app/services/user/user-dal";
export const normalizeUsername = async (username: string, userDAL: Pick<TUserDALFactory, "findOne">) => {
let attempt = slugify(username);
let attempt = slugify(`${username}-${alphaNumericNanoId(4)}`);
let user = await userDAL.findOne({ username: attempt });
if (!user) return attempt;