robodev 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/auth-chat/apps/fe/src/config/app.config.ts +2 -2
- package/templates/auth-chat/package.json +1 -1
- package/templates/backend/package.json +1 -1
- package/templates/empty/package.json +1 -1
- package/templates/space/apps/fe/src/config/app.config.ts +2 -2
- package/templates/space/apps/fe/src/utils/media-upload.ts +9 -3
- package/templates/space/package.json +1 -1
package/package.json
CHANGED
|
@@ -2,8 +2,8 @@ const authCustomJWT = {
|
|
|
2
2
|
enableMagicLink: import.meta.env.VITE_PUBLIC_AUTH_CUSTOM_JWT_ENABLE_MAGIC_LINK === "true",
|
|
3
3
|
};
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const apiOrigin =
|
|
5
|
+
const rawApiUrl = import.meta.env.VITE_PUBLIC_API_URL?.trim() ?? "";
|
|
6
|
+
const apiOrigin = /^https?:\/\//i.test(rawApiUrl) ? rawApiUrl.replace(/\/+$/, "") : "";
|
|
7
7
|
const apiMode = import.meta.env.VITE_PUBLIC_API_MODE ?? "real";
|
|
8
8
|
export const AppConfig = {
|
|
9
9
|
isProduction: import.meta.env.NODE_ENV === "production",
|
|
@@ -2,8 +2,8 @@ const authCustomJWT = {
|
|
|
2
2
|
enableMagicLink: import.meta.env.VITE_PUBLIC_AUTH_CUSTOM_JWT_ENABLE_MAGIC_LINK === "true",
|
|
3
3
|
};
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const apiOrigin =
|
|
5
|
+
const rawApiUrl = import.meta.env.VITE_PUBLIC_API_URL?.trim() ?? "";
|
|
6
|
+
const apiOrigin = /^https?:\/\//i.test(rawApiUrl) ? rawApiUrl.replace(/\/+$/, "") : "";
|
|
7
7
|
const apiMode = import.meta.env.VITE_PUBLIC_API_MODE ?? "real";
|
|
8
8
|
export const AppConfig = {
|
|
9
9
|
isProduction: import.meta.env.NODE_ENV === "production",
|
|
@@ -40,9 +40,15 @@ export function useMediaUploadHandler({ resourceName, method, onUploaded }: UseM
|
|
|
40
40
|
});
|
|
41
41
|
formData.append("file", file);
|
|
42
42
|
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
const origin = AppConfig.api.url.replace(/\/+$/, "");
|
|
44
|
+
const path = instructions.url;
|
|
45
|
+
const uploadUrl = /^https?:\/\//i.test(path)
|
|
46
|
+
? path
|
|
47
|
+
: origin
|
|
48
|
+
? `${origin}${path}`
|
|
49
|
+
: path.startsWith("/")
|
|
50
|
+
? path
|
|
51
|
+
: `/${path}`;
|
|
46
52
|
|
|
47
53
|
const response = await fetch(uploadUrl, {
|
|
48
54
|
method: instructions.method.toUpperCase(),
|