import { API_FAST_PLANS, API_FAST_CHECKS } from './http/api'
import { request } from './http/request';

export const getPlans = () => {
    return new Promise((resolve) => {
        request({
            url: API_FAST_PLANS, method: 'GET', data: {}
        }).then(res => {
            resolve(res);
            console.log(res);
            // dispatch(loginSuccess(res));
        })
    })
}

export const setPlan = (params: Record<string, any> | undefined) => {
    return new Promise((resolve) => {
        request({
            url: API_FAST_PLANS, method: 'POST', data: { ...params }
        }).then(res => {
            resolve(res);
            console.log(res);
            // dispatch(loginSuccess(res));
        })
    })
}

export const getChecks = () => {
    return new Promise((resolve) => {
        request({
            url: API_FAST_CHECKS, method: 'GET', data: {}
        }).then(res => {
            resolve(res);
            console.log(res);
            // dispatch(loginSuccess(res));
        })
    })
}