refactor(modules): update classes, course-plans, diagnostic, questions, settings, student, layout
- Update classes data-access (invitations, main) for invitation management - Update course-plans actions, data-access, and types - Update diagnostic data-access for report queries - Update questions data-access for question bank queries - Update settings actions, ai-provider-settings-card, data-access, and types - Update student course-filters, student-courses-view, student-schedule-filters, student-schedule-view - Update layout app-sidebar, site-header, and navigation config
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import "server-only";
|
||||
|
||||
import { randomInt } from "node:crypto"
|
||||
import { cache } from "react"
|
||||
import { and, asc, eq, inArray, isNull, sql } from "drizzle-orm"
|
||||
import { createId } from "@paralleldrive/cuid2"
|
||||
@@ -58,7 +57,7 @@ export const isDuplicateInvitationCodeError = (err: unknown): boolean => {
|
||||
}
|
||||
|
||||
const generateInvitationCode = (): string => {
|
||||
const n = randomInt(0, 1_000_000)
|
||||
const n = Math.floor(Math.random() * 1_000_000)
|
||||
return String(n).padStart(6, "0")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user