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:
20
src/lib/api/users.ts
Normal file
20
src/lib/api/users.ts
Normal 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'),
|
||||
};
|
||||
Reference in New Issue
Block a user