diff --git a/comps/form/utils/init.tsx b/comps/form/utils/init.tsx
index a8ffabd..32b8f10 100755
--- a/comps/form/utils/init.tsx
+++ b/comps/form/utils/init.tsx
@@ -158,7 +158,6 @@ export const formInit = (fm: FMLocal, props: FMProps) => {
if (!success) {
const errors = Object.keys(fm.error.list);
const count = errors.length;
- console.log(fm.error.list);
toast.error(
@@ -177,20 +176,18 @@ export const formInit = (fm: FMLocal, props: FMProps) => {
}
);
} else {
- if (!fm.is_newly_created) {
- toast.success(
-
-
- Saved
-
,
- {
- className: css`
- background: #e4ffed;
- border: 2px solid green;
- `,
- }
- );
- }
+ toast.success(
+
+
+ Saved
+
,
+ {
+ className: css`
+ background: #e4ffed;
+ border: 2px solid green;
+ `,
+ }
+ );
}
}
return success;
diff --git a/comps/list/TableList.tsx b/comps/list/TableList.tsx
index a71614b..d11991f 100755
--- a/comps/list/TableList.tsx
+++ b/comps/list/TableList.tsx
@@ -196,13 +196,22 @@ export const TableList: FC
= ({
},
};
} else {
- const field = rel.checked.find((e) => !e.is_pk);
+ const field = rel.checked.find(
+ (e) => !e.is_pk && !e.relation
+ );
if (field) {
local.sort.orderBy = {
[columnKey]: {
[field.name]: direction === "ASC" ? "asc" : "desc",
},
};
+ } else if (rel.relation) {
+ local.sort.orderBy = {
+ [columnKey]: {
+ [rel.relation.to.fields[0]]:
+ direction === "ASC" ? "asc" : "desc",
+ },
+ };
}
}
}
@@ -618,7 +627,8 @@ export const TableList: FC = ({
}
}
- let data = local.data || [];
+ let data = Array.isArray(local.data) ? local.data : [];
+ if (typeof local.data === "string") console.error(local.data);
if (isEditor) {
if (data.length > 0) {
diff --git a/comps/ui/toast.tsx b/comps/ui/toast.tsx
index c805c9e..aa388fd 100755
--- a/comps/ui/toast.tsx
+++ b/comps/ui/toast.tsx
@@ -3,7 +3,7 @@ import { toast as sonner } from "sonner";
const timer = {
timeout: null as any,
done: false,
- limit: 400,
+ limit: 200,
};
export const toast = {