add fcs shipment service
This commit is contained in:
23
lib/data/provider/fcs_shipment_data_provider.dart
Normal file
23
lib/data/provider/fcs_shipment_data_provider.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:fcs/domain/entities/fcs_shipment.dart';
|
||||
import 'package:fcs/helpers/api_helper.dart';
|
||||
import 'package:fcs/helpers/firebase_helper.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
class FcsShipmentDataProvider {
|
||||
final log = Logger('FcsShipmentDataProvider');
|
||||
|
||||
Future<void> createFcsShipment(FcsShipment fcsShipment) async {
|
||||
return await requestAPI("/fcs_shipments", "POST",
|
||||
payload: fcsShipment.toMap(), token: await getToken());
|
||||
}
|
||||
|
||||
Future<void> updateFcsShipment(FcsShipment fcsShipment) async {
|
||||
return await requestAPI("/fcs_shipments", "PUT",
|
||||
payload: fcsShipment.toMap(), token: await getToken());
|
||||
}
|
||||
|
||||
Future<void> deleteFcsShipment(FcsShipment fcsShipment) async {
|
||||
return await requestAPI("/fcs_shipments", "DELETE",
|
||||
payload: fcsShipment.toMap(), token: await getToken());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user