123456789101112131415161718192021222324252627282930313233343536 |
- import 'dart:convert';
- import 'dart:core';
- import 'package:http/http.dart' as http;
- import 'package:employee_selfservice_mobile/constants.dart';
- import 'dart:developer' as developer;
-
- import 'package:shared_preferences/shared_preferences.dart';
-
- class DetailSlipGaji_Post {
- late String batch_id;
- late String session;
-
- DetailSlipGaji_Post({required this.session});
-
- static Future<String> connectToAPI(String batch_id) async {
- String URL = baseURL + "/api/v1/detail_slip_gaji";
-
- final SharedPreferences prefs = await SharedPreferences.getInstance();
- final session = prefs.getString('session');
-
- var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
- "data": [
- {
- "batch_id" : batch_id,
- "session": session
- }
- ]
- }), headers: {
- "Content-Type": "application/json",
- "Api-key": apiKey
- });
-
- developer.log(sendData.body, name: "Detail Slip Gaji Result");
- return sendData.body;
- }
- }
|