create project
This commit is contained in:
30
frontend/lib/api/auth_api.dart
Normal file
30
frontend/lib/api/auth_api.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'api_client.dart';
|
||||
|
||||
class AuthApi {
|
||||
final ApiClient _client;
|
||||
AuthApi(this._client);
|
||||
|
||||
Future<Map<String, dynamic>> login(String phone, String password) {
|
||||
return _client.post('/auth/login', data: {'phone': phone, 'password': password});
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> register(String phone, String password, String nickname) {
|
||||
return _client.post('/auth/register', data: {'phone': phone, 'password': password, 'nickname': nickname});
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> logout() {
|
||||
return _client.post('/auth/logout');
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> getProfile() {
|
||||
return _client.get('/user/profile');
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> bindEmail(String email) {
|
||||
return _client.put('/user/email', data: {'email': email});
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> switchActiveFamily(String? familyId) {
|
||||
return _client.put('/user/active-family', data: {'familyId': familyId});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user