remsfal / remsfal-frontend

MIT License
4 stars 43 forks source link

The project list in the top bar is not updated after creating a new project #92

Closed astanik closed 4 months ago

FelixSiegfriedRiedel commented 4 months ago

I struggle to resolve why the top bar is not updating.

I turned it into a component in #121 that works as expected but the bug still persists even though the newProject object is passed to projectStore when a new project is created.

createProject() {
      const projectService = new ProjectService();
      const projectStore = useProjectStore();

      if (this.projectTitle.length > this.maxLength) return;

      projectService
          .createProject(this.projectTitle)
          .then((newProject: Project) => {
            projectStore.setSelectedProject(newProject);
            console.info("new project has been created: ", newProject);
            this.$router.push({
              name: "ProjectDashboard",
              params: { projectId: newProject.id },
            });
          });
    }
astanik commented 4 months ago

@FelixSiegfriedRiedel My guess is that the project is not in the list of projects in the ProjectStore and thus also not an option in the DropDown. You should refresh the list of projects in the ProjectStore after the new project was created.

Alternatively, we can leave this as bug. You should focus on your KAB issue and on completing your pull request

FelixSiegfriedRiedel commented 4 months ago

I was looking at it again but even after calling projectStore.refreshProjectList() I had no success. I will leave this as a bug.