Skip to content

Commit

Permalink
Fix moments examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jm42 committed Apr 12, 2024
1 parent 75fcb72 commit 9b9a579
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion examples/moments/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ async function main(): Promise<void> {
});

// We use Compass for read operations
const compass = new PoapCompass('your_api_key');
const compass = new PoapCompass({
apiKey: 'your_api_key',
});

// Use your library here
const client = new MomentsClient(momentsApi, compass);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FetchMomentsInput, Moment, MomentsClient } from '@poap-xyz/moments';
import { PaginatedResult } from '@poap-xyz/utils';
import { Order, PaginatedResult } from '@poap-xyz/utils';

export const fetch_moments_by_drop_ids = async (
client: MomentsClient,
Expand All @@ -9,7 +9,7 @@ export const fetch_moments_by_drop_ids = async (
offset: 0,
limit: 10,
drop_ids: [1],
idOrder: 'desc',
idOrder: Order.DESC,
};
console.log(input);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { FetchMomentsInput, Moment, MomentsClient } from '@poap-xyz/moments';
import { PaginatedResult } from '@poap-xyz/utils';
import { Order, PaginatedResult } from '@poap-xyz/utils';

export const fetch_multiple_moments = async (
client: MomentsClient,
): Promise<void> => {
const input: FetchMomentsInput = {
offset: 0,
limit: 10,
idOrder: 'desc',
idOrder: Order.DESC,
};

try {
Expand Down
4 changes: 2 additions & 2 deletions examples/moments/backend/src/methods/fetch_single_moment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FetchMomentsInput, Moment, MomentsClient } from '@poap-xyz/moments';
import { PaginatedResult } from '@poap-xyz/utils';
import { Order, PaginatedResult } from '@poap-xyz/utils';

export const fetch_single_moment = async (
client: MomentsClient,
Expand All @@ -8,7 +8,7 @@ export const fetch_single_moment = async (
offset: 0,
limit: 10,
id: '7284219b-1bc7-43b8-ab27-44749bdd91e1',
idOrder: 'desc',
idOrder: Order.DESC,
};
try {
const data: PaginatedResult<Moment> = await client.fetch(input);
Expand Down

0 comments on commit 9b9a579

Please sign in to comment.