|
@@ -47,7 +47,12 @@ export function LayoutConfigurationsTable() {
|
|
|
try {
|
|
try {
|
|
|
const result = await getLayoutConfigurations();
|
|
const result = await getLayoutConfigurations();
|
|
|
if (result.success) {
|
|
if (result.success) {
|
|
|
- setConfigurations(result.data || []);
|
|
|
|
|
|
|
+ const configurations = (result.data || []).map(config => ({
|
|
|
|
|
+ ...config,
|
|
|
|
|
+ createdAt: config.createdAt instanceof Date ? config.createdAt.toISOString() : config.createdAt,
|
|
|
|
|
+ updatedAt: config.updatedAt instanceof Date ? config.updatedAt.toISOString() : config.updatedAt,
|
|
|
|
|
+ }));
|
|
|
|
|
+ setConfigurations(configurations);
|
|
|
} else {
|
|
} else {
|
|
|
toast({
|
|
toast({
|
|
|
title: "Error",
|
|
title: "Error",
|
|
@@ -55,7 +60,7 @@ export function LayoutConfigurationsTable() {
|
|
|
variant: "destructive",
|
|
variant: "destructive",
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch {
|
|
|
toast({
|
|
toast({
|
|
|
title: "Error",
|
|
title: "Error",
|
|
|
description: "Failed to load configurations",
|
|
description: "Failed to load configurations",
|
|
@@ -82,7 +87,7 @@ export function LayoutConfigurationsTable() {
|
|
|
variant: "destructive",
|
|
variant: "destructive",
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ } catch {
|
|
|
toast({
|
|
toast({
|
|
|
title: "Error",
|
|
title: "Error",
|
|
|
description: "Failed to delete configuration",
|
|
description: "Failed to delete configuration",
|
|
@@ -154,7 +159,7 @@ export function LayoutConfigurationsTable() {
|
|
|
<AlertDialogHeader>
|
|
<AlertDialogHeader>
|
|
|
<AlertDialogTitle>Delete Configuration</AlertDialogTitle>
|
|
<AlertDialogTitle>Delete Configuration</AlertDialogTitle>
|
|
|
<AlertDialogDescription>
|
|
<AlertDialogDescription>
|
|
|
- Are you sure you want to delete "{config.name}"? This action cannot be undone.
|
|
|
|
|
|
|
+ Are you sure you want to delete {config.name}? This action cannot be undone.
|
|
|
</AlertDialogDescription>
|
|
</AlertDialogDescription>
|
|
|
</AlertDialogHeader>
|
|
</AlertDialogHeader>
|
|
|
<AlertDialogFooter>
|
|
<AlertDialogFooter>
|