umwd-components 0.1.779 → 0.1.780
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/dist/cjs/src/data/actions/media/minio/uploadMinioMediaAction.js +1 -1
- package/dist/cjs/src/data/services/common/media/minio/minio-service.js +1 -1
- package/dist/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/src/data/actions/media/minio/uploadMinioMediaAction.js +1 -0
- package/dist/esm/src/data/services/common/media/minio/minio-service.js +10 -5
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -32,6 +32,7 @@ async function uploadMinioMediaAction(prevState, formData) {
|
|
|
32
32
|
const fileName = rawFormData.fileName;
|
|
33
33
|
const files = rawFormData.files;
|
|
34
34
|
const fileContent = files instanceof File ? files : Buffer.from(files, "base64");
|
|
35
|
+
console.log(bucketName, fileName, fileContent);
|
|
35
36
|
// UPLOAD NEW IMAGE TO MINIO
|
|
36
37
|
const fileUploadResponse = await minioUploadService(bucketName, fileName, fileContent);
|
|
37
38
|
if (!fileUploadResponse) {
|
|
@@ -22,16 +22,21 @@ async function minioUploadService(bucketName, fileName, fileContent) {
|
|
|
22
22
|
throw new Error("No auth token found");
|
|
23
23
|
const baseUrl = getStrapiURL();
|
|
24
24
|
const url = new URL("/api/minio-plugin/minio/upload", baseUrl);
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
console.log("Sending to strapi minio-plugin:", {
|
|
26
|
+
bucketName,
|
|
27
|
+
fileName,
|
|
28
|
+
fileContent,
|
|
29
|
+
});
|
|
27
30
|
try {
|
|
28
31
|
const response = await fetch(url, {
|
|
29
32
|
headers: { Authorization: `Bearer ${authToken}` },
|
|
30
33
|
method: "POST",
|
|
31
34
|
body: JSON.stringify({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
data: {
|
|
36
|
+
bucketName,
|
|
37
|
+
fileName,
|
|
38
|
+
fileContent,
|
|
39
|
+
},
|
|
35
40
|
}),
|
|
36
41
|
});
|
|
37
42
|
const dataResponse = await response.json();
|