feature/projects-all-the-way-down #3323

Merged
konrad merged 123 commits from feature/projects-all-the-way-down into main 2023-05-30 10:09:40 +00:00
3 changed files with 8 additions and 11 deletions
Showing only changes of commit 6b824a49ab - Show all commits

View File

@ -477,14 +477,10 @@ async function newProject() {
if (currentProject.value === null) {
return
}
const newProject = await projectStore.createProject(new ProjectModel({
await projectStore.createProject(new ProjectModel({
title: query.value,
}))
success({ message: t('project.create.createdSuccess')})
await router.push({
name: 'project.index',
params: { projectId: newProject.id },
})
}
async function newTeam() {

View File

@ -1,7 +1,7 @@
import {watch, reactive, shallowReactive, unref, toRefs, readonly, ref, computed} from 'vue'
import {acceptHMRUpdate, defineStore} from 'pinia'
import {useI18n} from 'vue-i18n'
import {klona} from 'klona/lite'
import {useRouter} from 'vue-router'
import ProjectService from '@/services/project'
import {setModuleLoading} from '@/stores/helper'
@ -24,6 +24,7 @@ export interface ProjectState {
export const useProjectStore = defineStore('project', () => {
const baseStore = useBaseStore()
const router = useRouter()
const isLoading = ref(false)
@ -100,6 +101,10 @@ export const useProjectStore = defineStore('project', () => {
try {
const createdProject = await projectService.create(project)
setProject(createdProject)
router.push({
name: 'project.index',
params: { projectId: createdProject.id },
})
return createdProject

If I set an id for parentID in the passed project: will this update the parents childProjects?

If I set an id for `parentID` in the passed project: will this update the parents childProjects?

It did not. While checking this, I discovered how we're not using child ids anywhere any more (including in the api) so I've removed all traces of them.

It did not. While checking this, I discovered how we're not using child ids anywhere any more (including in the api) so I've removed all traces of them.
} finally {
cancel()

View File

@ -76,11 +76,7 @@ async function createNewProject() {
project.parentProjectId = parentProject.value.id
}
const newProject = await projectStore.createProject(project)
await router.push({
name: 'project.index',
params: { projectId: newProject.id },
})
await projectStore.createProject(project)
success({message: t('project.create.createdSuccess') })

Push to new project route in store.

Push to new project route in store.

Done.

Done.
}
</script>