import { saveFormData } from '@/api/platform/form';

import { HMessage } from '@crami/ui';

export async function saveCurrentVersion(data: any) {
  const { modelCode, templateId, formData, saveVersionInfo } = data;

  const res = await saveFormData(modelCode, templateId, formData, saveVersionInfo);

  if (res.code == 200) {
    HMessage.success('保存成功');
  } else {
    HMessage.error('保存失败');
    HMessage.error(res.msg);
  }

  return res.code;
}

export function saveNewVersion(data: any) {
  console.log('saveNewVersion data', data);
}

export function saveTheme(data: any) {
  console.log('saveTheme data', data);
}
