Skip to content

Commit 703374d

Browse files
init. fix build issue
1 parent ed0ab3e commit 703374d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

frontend/src/app/[slug]/changelog/[id]/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { useToast } from "@/components/ui/use-toast";
99
import FileUploadButton from '@/components/FileButton';
1010
import { Icons } from '@/components/icons';
1111
import dynamic from 'next/dynamic';
12+
import { useRouter } from 'next/navigation';
1213

1314
const EditorJS = dynamic(() => import('@editorjs/editorjs'), { ssr: false });
1415

@@ -25,6 +26,7 @@ const ChangelogEditor = ({ params }) => {
2526
const [newTag, setNewTag] = useState('');
2627
const [uploading, setUploading] = useState(false);
2728
const fileInputRef = useRef(null);
29+
const router = useRouter();
2830

2931
useEffect(() => {
3032
fetchChangelogData();
@@ -191,7 +193,7 @@ const ChangelogEditor = ({ params }) => {
191193
if (window.confirm('Are you sure you want to delete this changelog?')) {
192194
try {
193195
const response = await fetch('/api/auth/changelog/delete-changelog', {
194-
method: 'DELETE',
196+
method: 'POST',
195197
headers: {
196198
"x-org-slug": params.slug,
197199
"Content-Type": "application/json"
@@ -205,7 +207,7 @@ const ChangelogEditor = ({ params }) => {
205207
title: "Changelog Deleted",
206208
description: "The changelog has been successfully deleted.",
207209
});
208-
// Redirect or handle deletion success
210+
router.push(`/${params.slug}/changelog`);
209211
} catch (error) {
210212
toast({
211213
title: "Error",

frontend/src/app/[slug]/layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ function Navigation({ items, isActive, setCurrentSection, params, isCollapsed })
128128
isCollapsed && "px-0 lg:px-0")}>
129129
{items.map((item) => {
130130
if (item.type === 'divider') {
131-
return <div className="border-t border-dashed border-muted w-full"></div>
131+
return <div
132+
key={item.label}
133+
className="border-t border-dashed border-muted w-full"></div>
132134
} else if (item.type === 'label') {
133135
return <div key={item.label} className={cn("text-muted-foreground font-bold text-xs mt-4 w-full flex items-center px-3 py-2", isCollapsed && 'justify-center px-0')}>{isCollapsed ? item.label.substring(0, 3) : item.label}</div>
134136
} else {

0 commit comments

Comments
 (0)