File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff 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
7781const 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
105109const event = await fathom .api .events (' SITEID' ).get (' EVENT_ID' );
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ getAccountInfo();
2424// Example: List all sites
2525async 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 ) {
You can’t perform that action at this time.
0 commit comments