feat(loans): confirm declared material state changes
This commit is contained in:
@@ -12,6 +12,9 @@ class ResponsableService {
|
||||
static Future<List<Map<String, dynamic>>> emprunts() =>
|
||||
_liste("/responsable/emprunts");
|
||||
|
||||
static Future<List<Map<String, dynamic>>> ecarts() =>
|
||||
_liste("/responsable/ecarts");
|
||||
|
||||
static Future<List<Map<String, dynamic>>> materiels() =>
|
||||
_liste("/responsable/materiels");
|
||||
|
||||
@@ -49,6 +52,22 @@ class ResponsableService {
|
||||
return Map<String, dynamic>.from(reponse["data"] as Map);
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> deciderEcart({
|
||||
required int empruntId,
|
||||
required String decision,
|
||||
String? observation,
|
||||
String? statutMateriel,
|
||||
}) async {
|
||||
final reponse =
|
||||
await ApiClient.patch("/responsable/ecarts/$empruntId/decision", {
|
||||
"decision": decision,
|
||||
if (observation != null && observation.trim().isNotEmpty)
|
||||
"observation": observation.trim(),
|
||||
"statutMateriel": ?statutMateriel,
|
||||
});
|
||||
return Map<String, dynamic>.from(reponse["data"] as Map);
|
||||
}
|
||||
|
||||
static Future<List<Map<String, dynamic>>> _liste(String chemin) async {
|
||||
final reponse = await ApiClient.get(chemin);
|
||||
final data = reponse["data"] as List;
|
||||
|
||||
Reference in New Issue
Block a user