feat: change route path id
This commit is contained in:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user