mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-27 17:56:25 +02:00
feat: add getInvites method to invites API service
This commit is contained in:
parent
109cd4f091
commit
5c64182960
1 changed files with 19 additions and 0 deletions
|
|
@ -49,6 +49,25 @@ class InvitesApiService {
|
|||
}
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get all invites for a search space
|
||||
*/
|
||||
getInvites = async (request: GetInvitesRequest) => {
|
||||
const parsedRequest = getInvitesRequest.safeParse(request);
|
||||
|
||||
if (!parsedRequest.success) {
|
||||
console.error("Invalid request:", parsedRequest.error);
|
||||
|
||||
const errorMessage = parsedRequest.error.errors.map((err) => err.message).join(", ");
|
||||
throw new ValidationError(`Invalid request: ${errorMessage}`);
|
||||
}
|
||||
|
||||
return baseApiService.get(
|
||||
`/api/v1/searchspaces/${parsedRequest.data.search_space_id}/invites`,
|
||||
getInvitesResponse
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export const invitesApiService = new InvitesApiService();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue