Frontend first draft

This commit is contained in:
Arseni
2025-11-13 15:06:15 +03:00
parent e47f343afb
commit ddb54ddfdc
504 changed files with 25498 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
import 'dart:convert';
import 'package:logging/logging.dart';
import 'package:http/http.dart' as http;
import 'package:pshared/service/pfe/login.dart';
class PfeService {
static final _logger = Logger('service.pfe');
static Future<String> login(String email, String password) async {
_logger.fine('Logging in');
try {
final res = await http.post(
Uri.parse('http://localhost:3000/api/v1/auth/login'),
headers: {'Content-Type': 'application/json'},
body: json.encode(LoginRequest(login: email, password: password).toJson()),
);
return res.toString();
} catch (e) {
_logger.warning(e.toString());
rethrow;
}
}
}