-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/Fix: Add Prospects to Subcourse & Prevent Invalid Email Changes #560
base: main
Are you sure you want to change the base?
Conversation
realmayus
commented
Jun 6, 2024
- Add prospect list in course overview to allow instructors to add prospects (frontend part of Store prospect chats in subcourse entity backend#1093)
- prevent user from changing email to itself (violates uniqueness constraint in DB)
…pects, prevent user from changing email to itself (violates uniqueness constraint in DB)
const handleAddPupil = useCallback( | ||
async (pupilId: number) => { | ||
try { | ||
await addProspect({ variables: { subcourseId: subcourseId, pupilId: pupilId } }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while this is loading I could click the button again
data?.me?.email.toLowerCase().trim() === newEmail?.toLowerCase().trim() | ||
? t('reasonsDisabled.didNotChangeEmail') | ||
: t('reasonsDisabled.invalidEMail') | ||
} | ||
width={buttonWidth} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this "Prevent invalid email changes" - It just swaps the disabled message in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if it hits the uniqueness constraint we probably also miss validation on backend side.
(would prefer one change per PR) |