-
Notifications
You must be signed in to change notification settings - Fork 11
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: issue opened event #52
base: main
Are you sure you want to change the base?
Conversation
apps/github/src/@types/index.d.ts
Outdated
sender: { [key: string]: unknown }; | ||
repository: { [key: string]: unknown }; | ||
organization: { [key: string]: unknown }; | ||
installation: { [key: string]: unknown }; | ||
[key: string]: unknown; |
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.
So, we don't know the data type of these properties? As the value is set to unknown.
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.
This type can be constructed using Record utility type.
so, [key: string]: unknown
=> Record<string, unknown>
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.
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.
This type can be constructed using Record utility type.
so,
[key: string]: unknown
=>Record<string, unknown>
Done.
apps/github/src/@types/index.d.ts
Outdated
body: string | null; | ||
title: string; |
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.
If we just need body
and title
it's okay to define only them although the payload has other props.
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.
// check if the event is from registered repository | ||
if ( | ||
!askBuddieBot.isValidRepository( | ||
(payload.repository?.name as string) ?? '' |
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.
This doesn't work?
(payload.repository?.name as string) ?? '' | |
payload.repository?.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.
No description provided.