import 'package:tangheem/app_state/app_state.dart';
import 'package:tangheem/classes/consts.dart';
import 'package:tangheem/models/general_response_model.dart';

import 'api_client.dart';

class AdminConfigurationApiClient {
  static final AdminConfigurationApiClient _instance = AdminConfigurationApiClient._internal();

  AdminConfigurationApiClient._internal();

  factory AdminConfigurationApiClient() => _instance;

  Future<GeneralResponseModel> addDiscussion(String discussionText, String ayaTangheemTypeId) async {
    String url = "${ApiConsts.adminConfiguration}Discussion_Add";
    var postParams = {"discussionText": discussionText, "ayaTangheemTypeId": ayaTangheemTypeId, "statusId": 1};
    var _headers = {"Authorization": "Bearer ${AppState().token}"};
    return await ApiClient().postJsonForObject((json) => GeneralResponseModel.fromJson(json), url, postParams, headers: _headers);
  }
}
