feat(api): add typed API client, auth context, and integrate registration/login flows; docs: add backend integration guide and .env.example

This commit is contained in:
2025-09-23 20:45:29 +05:30
parent 9575db91e5
commit df2a2b9412
15 changed files with 556 additions and 20 deletions

20
src/lib/api/users.ts Normal file
View File

@@ -0,0 +1,20 @@
import { http } from '../http';
import type {
UpdateCompanyRequest,
UpdateGstRegistrationRequest,
UpdateUserProfileRequest,
UpgradeMembershipRequest,
UserProfile,
} from '../../types/api';
export const usersApi = {
profile: () => http.get<UserProfile>('/users/profile'),
updateProfile: (payload: UpdateUserProfileRequest) => http.put<UserProfile>('/users/profile', payload),
updateCompany: (payload: UpdateCompanyRequest) => http.put<UserProfile>('/users/company', payload),
updateGst: (payload: UpdateGstRegistrationRequest) => http.put<UserProfile>('/users/gst-registration', payload),
upgradeMembership: (payload: UpgradeMembershipRequest) => http.post<UserProfile>('/users/upgrade-membership', payload),
stats: () => http.get<any>('/users/stats'),
membershipInfo: () => http.get<any>('/users/membership-info'),
};