Notes: raise limits (3,000 notes, 200k chars each), reject instead of truncating oversize notes, save-error feedback, richer editor toolbar + word count, copy note; v2.42.0
Publish Container / build (push) Successful in 19m58s
Publish Container / build (push) Successful in 19m58s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ae0016cfee
commit
9710834b16
6 files changed
+57
-6
No files matched your search
+2
-2
@@ -122,8 +122,8 @@ export const MAX_STUDY_COMMENTS = 10000
|
||||
export const MAX_STUDY_COMMENT_LENGTH = 2000
|
||||
export const MAX_STUDY_USERS = 5000
|
||||
export const MAX_STUDY_ENROLLMENTS_PER_USER = 100
|
||||
export const MAX_STUDY_NOTES_PER_USER = 500
|
||||
export const MAX_STUDY_NOTE_LENGTH = 12000
|
||||
export const MAX_STUDY_NOTES_PER_USER = 3000
|
||||
export const MAX_STUDY_NOTE_LENGTH = 200000
|
||||
export const EMAIL_CHANGE_TOKEN_TTL_MS = 24 * 60 * 60 * 1000
|
||||
export const EMAIL_VERIFY_TOKEN_TTL_MS = 7 * 24 * 60 * 60 * 1000
|
||||
export const PASSWORD_RESET_TOKEN_TTL_MS = 60 * 60 * 1000
|
||||
|
||||
@@ -147,7 +147,11 @@ export function register(app) {
|
||||
return
|
||||
}
|
||||
const rawNote = typeof req.body?.note === 'string' ? req.body.note : ''
|
||||
const note = rawNote.trim().slice(0, MAX_STUDY_NOTE_LENGTH)
|
||||
const note = rawNote.trim()
|
||||
if (note.length > MAX_STUDY_NOTE_LENGTH) {
|
||||
res.status(413).json({ message: 'This lesson\'s notes are too long to save. Please trim some text.' })
|
||||
return
|
||||
}
|
||||
const notes = await loadUserNotes(user.id)
|
||||
|
||||
if (!note) {
|
||||
|
||||
Reference in new issue
Block a user