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

PCare partial support #26

Merged
merged 9 commits into from Jun 16, 2023
Merged

PCare partial support #26

merged 9 commits into from Jun 16, 2023

Conversation

mustofa-id
Copy link
Collaborator

@mustofa-id mustofa-id commented Jun 16, 2023

PR ini akan menambahkan dukungan PCare API namun secara partial sebab:

  • Sebagai FKRTL tidak memiliki user key untuk service tersebut
  • Belum menjadi prioritas

Barangkali di masa depan akan ada kontributor dari FKTP.

Dengan PR ini, request ke service PCare dapat dilakukan dengan cara:

await jkn.pcare.request({ /* option */ });

Tipe dari response belum tersedia out of the box, jadi perlu mendefinisi tipe sendiri berdasarkan service masing-masing, misal pada referensi diagnosa:

interface PCareDiagnosa {
	count: number;
	list: {
		kdDiag: string;
		nmDiag: string;
		nonSpesialis: boolean;
	}[];
}

const diagnosa = await jkn.pcare.request<PCareDiagnosa>({
	path: `/diagnosa/{param-1}/{param-2}/{param-3}`,
	method: 'GET'
});

console.log(diagnosa);
/*
{
	response: PCareDiagnosa | undefined;
	metaData: {
		code: number;
		message: string;
	};
}
*/

@changeset-bot
Copy link

changeset-bot bot commented Jun 16, 2023

🦋 Changeset detected

Latest commit: 7f8c2eb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@ssecd/jkn Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ssec-dev ssec-dev merged commit 62fae0e into main Jun 16, 2023
@ssec-dev ssec-dev deleted the pcare-partial branch June 16, 2023 07:16
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