import { EditorModule } from "..";
import { DesignTemp } from "../../objects/DesignTemp";

export const https = EditorModule.http({
  getDesignDetail(id: string) {
    return this.request("/h5/detail/" + id, {
      method: "GET",
    });
  },
  getCompDetail(id: string) {
    return this.request("/frame/detail/" + id, {
      method: "GET",
    });
  },
  saveDesign(data: Partial<DesignTemp>) {
    return this.request("/h5/update", {
      method: "POST",
      data,
    });
  },
  saveComp(data: Partial<DesignTemp>) {
    return this.request("/frame/update", {
      method: "POST",
      data,
    });
  },
  createComp(data: any) {
    return this.request("/frame/create", { method: "POST", data });
  },
});
