/* Copyright CloudLinux Zug GmbH 2010-2017 All Rights Reserved
 *
 * Licensed under CLOUD LINUX LICENSE AGREEMENT
 * http://cloudlinux.com/docs/LICENSE.TXT
 */

import { Injectable } from '@angular/core';
import { Http, Response, Headers, URLSearchParams } from '@angular/http';
import { isObject } from 'rxjs/util/isObject';
import { NotificationsService } from '../../app/services/notifiaction_service';


@Injectable()
export class XHR {
    request: Http;
    public mocks = {
        'cloudlinux-top': '{"mySqlGov": "enabled","result": "success","timestamp": 1471836662.461752,"users": []}'
    };


    constructor(private http?: Http) {
        this.request = http;
    }

    post(params: Object, testMode: boolean = false) {
      return new Promise((resolve, reject) => {
        resolve(this.mocks[params['command']]);
      });
    }

}
