Skip to content

Commit eb7bc5c

Browse files
committed
fix(healthcare): set responseType to JSON instead of Buffer
1 parent 9d8a04c commit eb7bc5c

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

healthcare/fhir/deleteFhirResource.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const main = (
2929
auth: new google.auth.GoogleAuth({
3030
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3131
}),
32+
responseType: 'json',
3233
});
3334

3435
const deleteFhirResource = async () => {
@@ -46,10 +47,14 @@ const main = (
4647
// fails, the server returns a 200 OK HTTP status code. To check that the
4748
// resource was successfully deleted, search for or get the resource and
4849
// see if it exists.
49-
await healthcare.projects.locations.datasets.fhirStores.fhir.delete(
50-
request
51-
);
52-
console.log('Deleted FHIR resource');
50+
try {
51+
await healthcare.projects.locations.datasets.fhirStores.fhir.delete(
52+
request
53+
);
54+
console.log(`Deleted FHIR resource: ${resourceId}`);
55+
} catch (error) {
56+
console.error('Error deleting FHIR resource:', error.message || error);
57+
}
5358
};
5459

5560
deleteFhirResource();

0 commit comments

Comments
 (0)