(slug: string)
| 69 | row: Pick<Organization, "id" | "name" | "workosUpdatedAt" | "deletedAt">, |
| 70 | ): Promise<Organization> => { |
| 71 | const slugTaken = async (slug: string) => { |
| 72 | const rows = await db |
| 73 | .select({ id: organizations.id }) |
| 74 | .from(organizations) |
| 75 | .where(eq(organizations.slug, slug)); |
| 76 | return rows.length > 0; |
| 77 | }; |
| 78 | for (let attempt = 0; attempt < 4; attempt++) { |
| 79 | const slug = await generateOrgSlug(row.name, slugTaken); |
| 80 | const [inserted] = await db |
nothing calls this directly
no outgoing calls
no test coverage detected