feat: change route path id

This commit is contained in:
2026-09-22 22:37:36 +07:00
parent 84a1319362
commit 5efb4d05cb
6 changed files with 42 additions and 27 deletions
+3 -3
View File
@@ -122,10 +122,10 @@ function CourseFormPage() {
await courseService.update(courseId, payload);
} else {
const created = await courseService.create(payload);
navigate(`/courses/${created.id}/detail`);
navigate(`/courses/detail/${created.id}`);
return;
}
navigate(`/courses/${courseId}/detail`);
navigate(`/courses/detail/${courseId}`);
} catch (err) {
setError(err.message || 'Failed to save course');
} finally {
@@ -168,7 +168,7 @@ function CourseFormPage() {
<Button
variant="outline"
className="rounded-xl bg-app-surface-muted text-app-text hover:bg-app-interactive-hover"
onClick={() => navigate(isEditing ? `/courses/${courseId}/detail` : '/courses')}
onClick={() => navigate(isEditing ? `/courses/detail/${courseId}` : '/courses')}
disabled={saving}
>
<HiOutlineArrowLeft className="w-4 h-4 mr-2" />