umwd-components 0.1.787 → 0.1.789

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.
@@ -16,7 +16,7 @@ import { MinioDeleteFormButton } from './MinioDeleteFormButton.js';
16
16
  * @returns MinioDisplay component
17
17
  */
18
18
  const MinioDisplay = ({ fileSize, mimeType, fileName, bucketName, direction = "column", revalidateCallback, }) => {
19
- return (jsxs(Stack, { direction: direction, spacing: 1, marginTop: 1, alignItems: direction === "column" ? "flex-start" : "center", children: [jsxs(Typography, { children: ["File: ", fileName] }), jsxs(Typography, { variant: "body2", color: "text.secondary", children: ["Size: ", fileSize, " bytes"] }), jsxs(Typography, { variant: "body2", color: "text.secondary", children: ["Type: ", mimeType] }), jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", justifyContent: "center", width: "min-content", children: [jsx(MinioDownloadButton, { bucketName: bucketName || "umwd", fileName: fileName || "" }), jsx(MinioDeleteFormButton, { bucketName: bucketName || "umwd", fileName: fileName || "", revalidateCallback: revalidateCallback })] })] }));
19
+ return (jsxs(Stack, { direction: direction, spacing: 1, marginTop: 1, alignItems: direction === "column" ? "flex-start" : "center", justifyContent: direction === "column" ? "flex-start" : "space-between", children: [jsxs(Typography, { children: ["File: ", fileName] }), jsxs(Typography, { variant: "body2", children: ["Size: ", fileSize, " bytes"] }), jsxs(Typography, { variant: "body2", children: ["Type: ", mimeType] }), jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", justifyContent: "center", width: "min-content", children: [jsx(MinioDownloadButton, { bucketName: bucketName || "umwd", fileName: fileName || "" }), jsx(MinioDeleteFormButton, { bucketName: bucketName || "umwd", fileName: fileName || "", revalidateCallback: revalidateCallback })] })] }));
20
20
  };
21
21
 
22
22
  export { MinioDisplay };
@@ -10,19 +10,15 @@ import { getAuthToken } from '../../../../services/get-token.js';
10
10
 
11
11
  const baseUrl = getStrapiURL();
12
12
  async function getAllMinioReferences(bucketName) {
13
- console.log("minio bucket:", bucketName);
14
13
  const authToken = await getAuthToken();
15
14
  const headers = {
16
- method: "POST",
15
+ method: "GET",
17
16
  headers: {
18
17
  "Content-Type": "application/json",
19
18
  Authorization: `Bearer ${authToken}`,
20
19
  },
21
- body: JSON.stringify({
22
- bucketName: bucketName ? bucketName : "umwd", // Default bucket if none provided
23
- }),
24
20
  };
25
- const url = new URL("/api/minio-plugin/minio/miniofilereference", baseUrl);
21
+ const url = new URL("/api/minio-plugin/miniofilereference", baseUrl);
26
22
  try {
27
23
  const response = await fetch(url, authToken ? headers : {});
28
24
  const data = await response.json();