fix(projects): sélectionner automatiquement le nouveau projet
This commit is contained in:
parent
55b30df823
commit
761f6f42a5
1 changed files with 5 additions and 3 deletions
|
|
@ -44,11 +44,13 @@ export default function ProjectForm() {
|
||||||
try {
|
try {
|
||||||
if (isEditing && projectId) {
|
if (isEditing && projectId) {
|
||||||
await updateProject(projectId, name, baseBranch);
|
await updateProject(projectId, name, baseBranch);
|
||||||
|
window.dispatchEvent(new Event("orchai:refresh-projects"));
|
||||||
|
navigate("/");
|
||||||
} else {
|
} else {
|
||||||
await createProject(name, pathOrUrl, baseBranch);
|
const project = await createProject(name, pathOrUrl, baseBranch);
|
||||||
|
window.dispatchEvent(new Event("orchai:refresh-projects"));
|
||||||
|
navigate(`/projects/${project.id}`);
|
||||||
}
|
}
|
||||||
window.dispatchEvent(new Event("orchai:refresh-projects"));
|
|
||||||
navigate("/");
|
|
||||||
} catch (err: unknown) {
|
} catch (err: unknown) {
|
||||||
setError(getErrorMessage(err));
|
setError(getErrorMessage(err));
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue