-
Notifications
You must be signed in to change notification settings - Fork 13
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
Only allow selecting one license on create dandiset page #1505
Only allow selecting one license on create dandiset page #1505
Conversation
98c3e7b
to
8df943d
Compare
8df943d
to
7f2a040
Compare
🚀 PR was released in |
@@ -159,7 +158,14 @@ if (!loggedIn()) { | |||
} | |||
|
|||
async function registerDandiset() { | |||
const metadata = { name: name.value, description: description.value, license: license.value }; | |||
const metadata: Record<string, any> = { |
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.
Shouldn't this be Record<"name" | "description", 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.
I'm guessing the reason this was done was to prevent the type checker from complaining when the license
field is added below.
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 you do
const metadata: {name: string, description: string, license?: LicenseType} = ...
🤷♂️
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.
Follow up on this - #1510
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.
Typechecking for the win!
Closes #1476