mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-09 22:14:29 +09:00
fixing issues
This commit is contained in:
1 parent
4e415c35ee
commit
fc2027fda5
3 files changed
+5
-7
No files matched your search
@@ -20,7 +20,7 @@ import env from "~/shared/env";
|
||||
type PublishButtonProps = { project: Project };
|
||||
|
||||
const host = () => {
|
||||
if (env.PUBLISHER_ENDPOINT && env.PUBLISHER_DOMAIN !== "") {
|
||||
if (env.PUBLISHER_ENDPOINT && env.PUBLISHER_DOMAIN) {
|
||||
return env.PUBLISHER_DOMAIN;
|
||||
}
|
||||
if (typeof location === "object") {
|
||||
@@ -29,6 +29,7 @@ const host = () => {
|
||||
}
|
||||
return "";
|
||||
};
|
||||
console.log(host());
|
||||
|
||||
const Content = ({ project }: PublishButtonProps) => {
|
||||
const id = useId();
|
||||
|
||||
@@ -5,8 +5,8 @@ const env = {
|
||||
VERCEL_ENV: process.env.VERCEL_ENV,
|
||||
DEBUG: process.env.DEBUG,
|
||||
FEATURES: process.env.FEATURES,
|
||||
PUBLISHER_ENDPOINT: process.env.PUBLISHER_ENDPOINT,
|
||||
PUBLISHER_DOMAIN: process.env.PUBLISHER_DOMAIN,
|
||||
PUBLISHER_ENDPOINT: process.env.PUBLISHER_ENDPOINT || null,
|
||||
PUBLISHER_DOMAIN: process.env.PUBLISHER_DOMAIN || null,
|
||||
} as const;
|
||||
|
||||
export default env;
|
||||
|
||||
@@ -9,12 +9,9 @@ const schema = zfd.formData({
|
||||
|
||||
export const action: ActionFunction = async ({ request }) => {
|
||||
const { domain, projectId } = schema.parse(await request.formData());
|
||||
if (!domain || !projectId) {
|
||||
throw new Error("Domain or ProjectId not provided.");
|
||||
}
|
||||
try {
|
||||
await db.misc.publish({ projectId, domain });
|
||||
if (process.env.PUBLISHER_ENDPOINT) {
|
||||
if (process.env.PUBLISHER_ENDPOINT && process.env.PUBLISHER_TOKEN) {
|
||||
const headers = new Headers();
|
||||
headers.append("X-AUTH-WEBSTUDIO", process.env.PUBLISHER_TOKEN || "");
|
||||
headers.append("Content-Type", "text/plain");
|
||||
|
||||
Reference in new issue
Block a user