Skip to content

Commit 3055512

Browse files
committed
Update to use conv methods
1 parent 7084eee commit 3055512

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ async function getAccountInfo() {
5858
const account = await fathom.api.account.get();
5959
console.log('Account:', account);
6060
} catch (error) {
61-
console.error('Error:', error);
61+
if (error instanceof FathomApiError) {
62+
console.error('API Error:', error.message);
63+
} else {
64+
console.error('Error:', error);
65+
}
6266
}
6367
}
6468

@@ -71,7 +75,7 @@ getAccountInfo();
7175

7276
```typescript
7377
// List all sites
74-
const sites = await fathom.api.sites.list();
78+
const sites = await fathom.api.getAllSites();
7579

7680
// Get a specific site
7781
const site = await fathom.api.sites.get('SITEID');
@@ -99,7 +103,7 @@ const deletedSite = await fathom.api.sites.delete('SITEID');
99103

100104
```typescript
101105
// List all events for a site
102-
const events = await fathom.api.events('SITEID').list();
106+
const events = await fathom.api.getAllEvents('SITEID');
103107

104108
// Get a specific event
105109
const event = await fathom.api.events('SITEID').get('EVENT_ID');

examples/basic-usage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ getAccountInfo();
2424
// Example: List all sites
2525
async function listSites() {
2626
try {
27-
const sites = await fathom.api.sites.list();
27+
const sites = await fathom.api.getAllSites();
2828
console.log('Sites:', sites);
2929
} catch (error) {
3030
if (error instanceof FathomApiError) {

0 commit comments

Comments
 (0)