Assign project when assigning sprint (#2612)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov
2023-02-10 23:39:02 +07:00
committed by GitHub
parent f2ed55eefa
commit df7667289d
3 changed files with 25 additions and 4 deletions
@@ -593,12 +593,17 @@
object = { ...object, project: projectId }
}
const handleSprintIdChanged = (sprintId: Ref<Sprint> | null | undefined) => {
const handleSprintIdChanged = async (sprintId: Ref<Sprint> | null | undefined) => {
if (sprintId === undefined) {
return
}
let projectSprintId: Ref<Project> | null
if (sprintId != null) {
const sprint = await client.findOne(tracker.class.Sprint, { _id: sprintId })
projectSprintId = sprint && sprint.project ? sprint.project : null
} else projectSprintId = null
object = { ...object, sprint: sprintId }
object = { ...object, sprint: sprintId, project: projectSprintId }
}
function addTagRef (tag: TagElement): void {