-
Notifications
You must be signed in to change notification settings - Fork 73
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
Simplifying gateways' return values #7863
Conversation
Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:
|
Your environment is deployed to https://ocrvs-2520.opencrvs.dev |
@@ -637,7 +596,7 @@ export const resolvers: GQLResolver = { | |||
return taskEntry.resource.id | |||
}, | |||
async confirmRegistration(_, { id }, { headers: authHeader }) { | |||
if (!inScope(authHeader, ['record.confirm-registration'])) { | |||
if (!inScope(authHeader, ['record.confirm-registration'] as unknown as Scope[])) { |
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.
confirmRegistration: 'record.confirm-registration' |
as unknown as Scope[]
should be needed
packages/gateway/src/constants.ts
Outdated
@@ -16,7 +16,7 @@ export const AVATAR_API = | |||
|
|||
export const NATIVE_LANGUAGE = (() => { | |||
const languages = env.LANGUAGES.split(',') | |||
return languages.find((language) => language !== 'en') | |||
return languages.find((language: string) => language !== 'en') |
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.
the parameter "language" was being implicitly given an any type which was causing an error when i ran the tests
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.
Good stuff simplifying the endpoints. Small comments to assess
@noah-brunate tests seem to be failing to unused variable but otherwise this looks like it's ready to go 👍 Great work |
) | ||
} | ||
return true |
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.
@noah-brunate removing this line here might break things as people could be expecting a boolean return value from the API.
This change is also the reason why you had to change the expectations in the test file. Let's bring this back please
Simplified the return values for the gateways' resolver functions.