Files
openhuman/src/services/api/userApi.ts
T
M3gA-Mind 159e111a29 feat: enhance Gmail skill integration and state management
- 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.
2026-02-20 20:45:36 +05:30

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',
{}
);
},
};