Removed template blockers for the time being IO-424
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Button } from "antd";
|
||||
import axios from "axios";
|
||||
import gql from "graphql-tag";
|
||||
import inlineCss from "inline-css";
|
||||
//import inlineCss from "inline-css";
|
||||
import { JsonEditor as Editor } from "jsoneditor-react";
|
||||
import "jsoneditor-react/es/editor.min.css";
|
||||
import React, { useState } from "react";
|
||||
@@ -32,31 +32,31 @@ export function ShopTemplateTestRender({
|
||||
const handleTestRender = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
alert("IO-424 Blocks this.")
|
||||
// emailEditorRef.current.exportHtml(async (data) => {
|
||||
// inlineCss(data.html, {
|
||||
// url: `${window.location.protocol}://${window.location.host}/`,
|
||||
// }).then(async function (inlineHtml) {
|
||||
// try {
|
||||
// const { data: contextData } = await client.query({
|
||||
// query: gql(query),
|
||||
// variables: variables,
|
||||
// fetchPolicy: "network-only",
|
||||
// });
|
||||
|
||||
emailEditorRef.current.exportHtml(async (data) => {
|
||||
inlineCss(data.html, {
|
||||
url: `${window.location.protocol}://${window.location.host}/`,
|
||||
}).then(async function (inlineHtml) {
|
||||
try {
|
||||
const { data: contextData } = await client.query({
|
||||
query: gql(query),
|
||||
variables: variables,
|
||||
fetchPolicy: "network-only",
|
||||
});
|
||||
// const { data } = await axios.post("/render", {
|
||||
// view: inlineHtml,
|
||||
// context: { ...contextData, bodyshop: bodyshop },
|
||||
// });
|
||||
// displayTemplateInWindowNoprint(data);
|
||||
|
||||
const { data } = await axios.post("/render", {
|
||||
view: inlineHtml,
|
||||
context: { ...contextData, bodyshop: bodyshop },
|
||||
});
|
||||
displayTemplateInWindowNoprint(data);
|
||||
|
||||
setLoading(false);
|
||||
} catch (error) {
|
||||
setLoading(false);
|
||||
alert(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
// setLoading(false);
|
||||
// } catch (error) {
|
||||
// setLoading(false);
|
||||
// alert(error);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
} catch (error) {
|
||||
setLoading(false);
|
||||
alert(error);
|
||||
|
||||
Reference in New Issue
Block a user