-
Notifications
You must be signed in to change notification settings - Fork 4
feat: handle transfer request notification #846
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
base: main
Are you sure you want to change the base?
Conversation
| const source = props.notification.details.transfer_owner | ||
| const sourceName = 'first_name' in source ? `${source.first_name} ${source.last_name}` : source.name | ||
| const subject = props.notification.details.transfer_subject | ||
| const subjectPath = `${subject.class.toLowerCase()}s` |
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.
Is it possible to have a explicit mapping if there is not a lot of subjects types?
| const details = computed(() => { | ||
| const recipient = props.notification.details.transfer_recipient | ||
| const source = props.notification.details.transfer_owner | ||
| const sourceName = 'first_name' in source ? `${source.first_name} ${source.last_name}` : source.name |
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.
Is this working:
| const sourceName = 'first_name' in source ? `${source.first_name} ${source.last_name}` : source.name | |
| const sourceName = source.class === 'User' ? `${source.first_name} ${source.last_name}` : source.name |
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.
I'll update the OrganizationReference and UserReference types to have the class and then pray that typescript is smart
| const sourceName = 'first_name' in source ? `${source.first_name} ${source.last_name}` : source.name | ||
| const subject = props.notification.details.transfer_subject | ||
| const subjectPath = `${subject.class.toLowerCase()}s` | ||
| if ('first_name' in recipient) { |
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.
Can we use recipient.class instead?
| if ('first_name' in recipient) { | |
| if (recipient.class === 'User') { |
|
I think it could be merge before the udata part without any conflicts? |
No description provided.