Skip to content

Commit

Permalink
feat(hub-common): add searchEvents function (#1778)
Browse files Browse the repository at this point in the history
  • Loading branch information
velveetachef authored Jan 29, 2025
1 parent 2e9036e commit 2996bc8
Show file tree
Hide file tree
Showing 4 changed files with 266 additions and 123 deletions.
16 changes: 16 additions & 0 deletions packages/common/src/events/api/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import {
IGetEventsParams,
IUpdateEventParams,
IDeleteEventParams,
ISearchEventsParams,
} from "./types";
import { authenticateRequest } from "./utils/authenticate-request";
import {
createEvent as _createEvent,
getEvents as _getEvents,
searchEvents as _searchEvents,
getEvent as _getEvent,
updateEvent as _updateEvent,
deleteEvent as _deleteEvent,
Expand All @@ -31,6 +33,7 @@ export async function createEvent(

/**
* get events
* @deprecated use searchEvents instead
*
* @param {IGetEventsParams} options
* @return {Promise<IPagedEventResponse>}
Expand All @@ -42,6 +45,19 @@ export async function getEvents(
return _getEvents(options.data, options);
}

/**
* search events
*
* @param {ISearchEventsParams} options
* @return {Promise<IPagedEventResponse>}
*/
export async function searchEvents(
options: ISearchEventsParams
): Promise<IPagedEventResponse> {
options.token = await authenticateRequest(options);
return _searchEvents(options.data, options);
}

/**
* get an event
*
Expand Down
Loading

0 comments on commit 2996bc8

Please sign in to comment.