release: squash merge develop → master (#211,#212) #213

Closed
jmartin wants to merge 71 commits from develop into master
2 changed files with 7 additions and 6 deletions
Showing only changes of commit 8204669ec9 - Show all commits
@@ -2,11 +2,11 @@ import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:p_tits_pas/models/absence_garde.dart';
import 'package:p_tits_pas/services/api/api_config.dart';
import 'package:p_tits_pas/services/auth_service.dart';
import 'package:p_tits_pas/services/api/tokenService.dart';
class AbsencesGardeService {
static Future<List<AbsenceGarde>> getAbsences({String? placementId}) async {
final token = await AuthService.getToken();
final token = await TokenService.getToken();
final headers = token != null ? ApiConfig.authHeaders(token) : ApiConfig.headers;
final uri = Uri.parse(ApiConfig.baseUrl +
@@ -30,7 +30,7 @@ class AbsencesGardeService {
required String dateFin,
String? motif,
}) async {
final token = await AuthService.getToken();
final token = await TokenService.getToken();
final headers = token != null ? ApiConfig.authHeaders(token) : ApiConfig.headers;
final uri = Uri.parse('${ApiConfig.baseUrl}/absences-garde');
@@ -59,7 +59,7 @@ class AbsencesGardeService {
String? statut,
String? motif,
}) async {
final token = await AuthService.getToken();
final token = await TokenService.getToken();
final headers = token != null ? ApiConfig.authHeaders(token) : ApiConfig.headers;
final uri = Uri.parse('${ApiConfig.baseUrl}/absences-garde/$id');
@@ -82,7 +82,7 @@ class AbsencesGardeService {
}
static Future<void> supprimerAbsence(String id) async {
final token = await AuthService.getToken();
final token = await TokenService.getToken();
final headers = token != null ? ApiConfig.authHeaders(token) : ApiConfig.headers;
final uri = Uri.parse('${ApiConfig.baseUrl}/absences-garde/$id');
+2 -1
View File
@@ -96,7 +96,8 @@ class ApiConfig {
};
static Map<String, String> authHeaders(String token) => {
...headers,
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer $token',
};
}