import { configStore } from "../store/store";
import { apiService } from "../utils/axios";
export const getFileSignRequest = async (params) => {
    const businessId = configStore.get('businessId');
    const shopId = configStore.get('shopId');
    const { fileName, usageType } = params;
    const { data, status } = await apiService().post(`api/${businessId}/${shopId}/file/sign`, {
        file_name: fileName,
        usage_type: usageType,
    });
    if (status === 200) {
        return data;
    }
    throw new Error('Failed to get file sign');
};
export const uploadFileConfirmRequest = async (id) => {
    const businessId = configStore.get('businessId');
    const shopId = configStore.get('shopId');
    const { data, status } = await apiService().post(`api/${businessId}/${shopId}/file/${id}/confirm`);
    if (status === 200) {
        return data;
    }
    throw new Error('Failed to confirm file upload');
};
