TSM-10: convert Group E services to TypeScript - #567
TSM-10: convert Group E services to TypeScript#567Justin Hammond (Justintime50) wants to merge 61 commits into
Conversation
69c8c8b to
93e68fb
Compare
93e68fb to
c90af9b
Compare
c90af9b to
8933de0
Compare
8933de0 to
9622437
Compare
9622437 to
300b5f2
Compare
300b5f2 to
5bc2d21
Compare
5bc2d21 to
94962c3
Compare
94962c3 to
ec215aa
Compare
ec215aa to
77937f5
Compare
4a8ec7d to
28d3ae6
Compare
28d3ae6 to
76e1f34
Compare
76e1f34 to
916d36e
Compare
a52c884 to
d1308b6
Compare
518df81 to
552d812
Compare
Alex Matthews (ralexmatthews)
left a comment
There was a problem hiding this comment.
Few comments, nothing blocking
| user.children?.forEach((child) => { | ||
| if (child.id == id) { | ||
| return child.keys; | ||
| return child.keys ?? []; |
There was a problem hiding this comment.
Issue:
This is unrelated to your changes here, but I don't think this would actually work the way it looks like is intended here. This return child.keys ?? []; only returns in the forEach arrow fn, not for the outside scope. If you wanted to return those child keys from the retrieveApiKeysForUser outside fn, you would need to either do like a user.children?.find and return that, or change this to like a for (child in user.children ?? []) { loop.
| /* eslint-disable no-unused-vars */ | ||
| type ReferralScopedClient = { |
There was a problem hiding this comment.
question:
Is this temporary, or is there a reason we are keeping this arround?
| const body = response.body as Record<string, unknown>; | ||
| return body.public_key as string; |
There was a problem hiding this comment.
thought:
If we are asserting the type anyway, we could shorten this to
const body = response.body as { public_key: string };
return body.public_key;| referralApiKey: string, | ||
| stripeCreditCardToken: string, | ||
| priority: string, | ||
| ): Promise<Record<string, unknown>> { |
There was a problem hiding this comment.
nit:
Unspecific return type here.
Summary
Validation