"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateApp = exports.fetchAllLocales = exports.fetchAppDetail = exports.fetchAllApplicationList = exports.addApp = exports.fetchList = void 0;
const api_agent_1 = __importDefault(require("@/utils/api-agent"));
const fetchList = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/application-searchs', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchList = fetchList;
const addApp = (params) => new Promise((resolve) => {
    api_agent_1.default.post('/applications', params, (rs) => {
        resolve(rs);
    });
});
exports.addApp = addApp;
const fetchAllApplicationList = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/applications-all-searchs', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchAllApplicationList = fetchAllApplicationList;
const fetchAppDetail = ({ applicationId, }) => new Promise((resolve) => {
    api_agent_1.default.get('/applications', { applicationId }, (rs) => {
        resolve(rs);
    });
});
exports.fetchAppDetail = fetchAppDetail;
// settings
const fetchAllLocales = ({ applicationId, }) => new Promise((resolve) => {
    api_agent_1.default.get('/applications/locales', { applicationId }, (rs) => {
        resolve(rs);
    });
});
exports.fetchAllLocales = fetchAllLocales;
const updateApp = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/applications', params, (rs) => {
        resolve(rs);
    });
});
exports.updateApp = updateApp;
