No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

detailSlipGaji_post.dart 981B

123456789101112131415161718192021222324252627282930313233343536
  1. import 'dart:convert';
  2. import 'dart:core';
  3. import 'package:http/http.dart' as http;
  4. import 'package:employee_selfservice_mobile/constants.dart';
  5. import 'dart:developer' as developer;
  6. import 'package:shared_preferences/shared_preferences.dart';
  7. class DetailSlipGaji_Post {
  8. late String batch_id;
  9. late String session;
  10. DetailSlipGaji_Post({required this.session});
  11. static Future<String> connectToAPI(String batch_id) async {
  12. String URL = baseURL + "/api/v1/detail_slip_gaji";
  13. final SharedPreferences prefs = await SharedPreferences.getInstance();
  14. final session = prefs.getString('session');
  15. var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
  16. "data": [
  17. {
  18. "batch_id" : batch_id,
  19. "session": session
  20. }
  21. ]
  22. }), headers: {
  23. "Content-Type": "application/json",
  24. "Api-key": apiKey
  25. });
  26. developer.log(sendData.body, name: "Detail Slip Gaji Result");
  27. return sendData.body;
  28. }
  29. }