Skip to content

Commit 5d9f94c

Browse files
angelcaamaliennae
andauthored
fix(healthcare): set responseType to JSON instead of Buffer (#4239)
Co-authored-by: Jennifer Davis <sigje@google.com>
1 parent c098659 commit 5d9f94c

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

healthcare/fhir/listFhirStores.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const main = (
2626
auth: new google.auth.GoogleAuth({
2727
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2828
}),
29+
responseType: 'json',
2930
});
3031

3132
const listFhirStores = async () => {
@@ -36,9 +37,13 @@ const main = (
3637
const parent = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}`;
3738
const request = {parent};
3839

39-
const fhirStores =
40-
await healthcare.projects.locations.datasets.fhirStores.list(request);
41-
console.log(JSON.stringify(fhirStores.data));
40+
try {
41+
const fhirStores =
42+
await healthcare.projects.locations.datasets.fhirStores.list(request);
43+
console.log(JSON.stringify(fhirStores.data));
44+
} catch (error) {
45+
console.error('Error listing FHIR stores:', error.message || error);
46+
}
4247
};
4348

4449
listFhirStores();

0 commit comments

Comments
 (0)