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

Simplifying gateways' return values #7863

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Simplifying gateways' return values #7863

wants to merge 4 commits into from

Conversation

noah-brunate
Copy link
Collaborator

Simplified the return values for the gateways' resolver functions.

Copy link

Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:

  • Changelog is read by country implementors who might not always be familiar with all technical details of OpenCRVS. Keep language high-level, user friendly and avoid technical references to internals.
  • Answer "What's new?", "Why was the change made?" and "Why should I care?" for each change.
  • If it's a breaking change, include a migration guide answering "What do I need to do to upgrade?".

@ocrvs-bot
Copy link
Collaborator

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[])) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@noah-brunate

confirmRegistration: 'record.confirm-registration'
The scope should actually be there so no casting as unknown as Scope[] should be needed

@@ -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')
Copy link
Collaborator

Choose a reason for hiding this comment

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

image
This is an unnecessary assertion: the compiler seems to already know it's a string.

Copy link
Collaborator Author

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

Copy link
Collaborator

@naftis naftis left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants