Skip to content
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

Add more typing for history objects #277

Merged
merged 1 commit into from
Apr 29, 2023
Merged

Add more typing for history objects #277

merged 1 commit into from
Apr 29, 2023

Conversation

zichongkao
Copy link
Contributor

@zichongkao zichongkao commented Apr 29, 2023

  • Changes kind to be an enum instead of string.
  • Add exhaustive checks at switch statements.
  • Add OrganizationType as a SupportedCollectionType.

@zichongkao zichongkao force-pushed the kao-history-types branch 2 times, most recently from 93a5e35 to 9f89a09 Compare April 29, 2023 00:55
case DocumentKind.organizations:
return 'Organization'
default:
return exhaustiveCheck(node.kind)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know if there's a better way to do this!

@@ -49,7 +50,7 @@ const onChange = (change: ChangeStreamDocument): void => {
case 'replace':
case 'update': {
let dbOp: DBOperation = 'update'
const source = change.ns.coll
const source = DocumentKind[change.ns.coll]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope this is fine. Dunno if we can type change.ns.coll as well.

@zichongkao zichongkao requested a review from vnugent April 29, 2023 05:57
@vnugent vnugent merged commit 75d7bf5 into develop Apr 29, 2023
1 check passed
@vnugent
Copy link
Contributor

vnugent commented Apr 29, 2023

Thanks for the fix. In general I think we should prioritize climb & area history. As you said in the other comment the LCO edit feature will be used by very a few trusted individual.

@vnugent
Copy link
Contributor

vnugent commented May 3, 2023

@all-contributors add @zichongkao @musoke for code & ideas

@allcontributors
Copy link
Contributor

@vnugent

I've put up a pull request to add @zichongkao! 🎉

l4u532 pushed a commit to l4u532/openbeta-graphql that referenced this pull request Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants