diff --git a/components/form/field/FilePreview.tsx b/components/form/field/FilePreview.tsx
index 9be4f4d..e5db92c 100644
--- a/components/form/field/FilePreview.tsx
+++ b/components/form/field/FilePreview.tsx
@@ -211,12 +211,16 @@ export const FilePreview = ({ url }: { url: any }) => {
{file.extension && (
{
window.open(_url, "_blank");
}}
>
- {content}
+
{content}
+
{file?.name}
+
@@ -287,6 +293,7 @@ const getFileName = (url: string) => {
}
const fileName = url.substring(url.lastIndexOf("/") + 1);
+ console.log({ fileName });
const dotIndex = fileName.lastIndexOf(".");
const fullname = fileName;
if (dotIndex === -1) {
diff --git a/helpers/user.ts b/helpers/user.ts
index 190fede..ea90603 100644
--- a/helpers/user.ts
+++ b/helpers/user.ts
@@ -6,26 +6,28 @@ export const userToken = async () => {
if (user) {
const w = window as any;
w.user = JSON.parse(user);
- }else{
- const res = await api.get(`${process.env.NEXT_PUBLIC_API_PORTAL}/api/check-jwt-token`);
- const jwt = res.data.data;
- console.log({jwt})
- if (!jwt) return ;
+ } else {
try {
- await api.post(process.env.NEXT_PUBLIC_BASE_URL + "/api/cookies", {
- token: jwt,
- });
- const user = await api.get(
- `${process.env.NEXT_PUBLIC_API_PORTAL}/api/users/me`
+ const res = await api.get(
+ `${process.env.NEXT_PUBLIC_API_PORTAL}/api/check-jwt-token`
);
- const us = user.data.data;
- console.log({us})
- if (us) {
- localStorage.setItem("user", JSON.stringify(user.data.data));
- const roles = await userRoleMe();
- }
- } catch (e) {
- }
- console.log({res})
+ const jwt = res.data.data;
+ console.log({ jwt });
+ if (!jwt) return;
+ try {
+ await api.post(process.env.NEXT_PUBLIC_BASE_URL + "/api/cookies", {
+ token: jwt,
+ });
+ const user = await api.get(
+ `${process.env.NEXT_PUBLIC_API_PORTAL}/api/users/me`
+ );
+ const us = user.data.data;
+ console.log({ us });
+ if (us) {
+ localStorage.setItem("user", JSON.stringify(user.data.data));
+ const roles = await userRoleMe();
+ }
+ } catch (e) {}
+ } catch (ex) {}
}
};
diff --git a/package.json b/package.json
index 0ea7944..c999d7a 100644
--- a/package.json
+++ b/package.json
@@ -48,6 +48,7 @@
"lodash.uniqby": "^4.7.0",
"lucide-react": "^0.462.0",
"next": "15.0.3",
+ "react-beautiful-dnd": "^13.1.1",
"react-colorful": "^5.6.1",
"react-icons": "^5.3.0",
"react-resizable": "^3.0.5",
@@ -61,6 +62,7 @@
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
+ "@types/react-beautiful-dnd": "^13.1.8",
"@types/react-dom": "^18",
"@types/react-resizable": "^3.0.8",
"@types/react-slick": "^0.23.13",