mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
- Updated `SkillManager` to accept an optional access token for Gmail during OAuth completion. - Introduced `gmailSlice` to manage Gmail user profile and emails in the Redux store. - Implemented synchronization of Gmail skill state with the Redux store to keep user data updated. - Refactored `SkillProvider` to handle Gmail state changes and fetch initial state from the backend. - Adjusted deep link handling to pass decrypted access tokens for Gmail integration. - Modified API endpoint for onboarding completion to remove the Telegram prefix.
31 lines
769 B
TypeScript
31 lines
769 B
TypeScript
import type { GetMeResponse, User } from '../../types/api';
|
|
import { apiClient } from '../apiClient';
|
|
|
|
/**
|
|
* User API endpoints
|
|
*/
|
|
export const userApi = {
|
|
/**
|
|
* Get current authenticated user information
|
|
* GET /telegram/me
|
|
*/
|
|
getMe: async (): Promise<User> => {
|
|
const response = await apiClient.get<GetMeResponse>('/telegram/me');
|
|
if (!response.success) {
|
|
throw new Error(response.error || 'Failed to fetch user data');
|
|
}
|
|
return response.data;
|
|
},
|
|
|
|
/**
|
|
* Mark onboarding complete for the current user.
|
|
* POST /settings/onboarding-complete
|
|
*/
|
|
onboardingComplete: async (): Promise<void> => {
|
|
await apiClient.post<{ success: boolean; data: unknown }>(
|
|
'/settings/onboarding-complete',
|
|
{}
|
|
);
|
|
},
|
|
};
|