mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 11:42:30 +03:00
uberf-6639: fix create issue default status (#5685)
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
parent
2d163bf428
commit
619939b2a5
@ -114,7 +114,7 @@ export async function createState<T extends Status> (
|
||||
if (exists !== undefined) {
|
||||
return exists._id as Ref<T>
|
||||
}
|
||||
const res = await client.createDoc(_class, task.space.Statuses, data)
|
||||
const res = await client.createDoc(_class, core.space.Model, data)
|
||||
return res
|
||||
}
|
||||
|
||||
|
@ -96,15 +96,18 @@
|
||||
return current
|
||||
}
|
||||
}
|
||||
|
||||
if (defaultIssueStatus !== undefined) {
|
||||
const res = statuses?.find((status) => status._id === defaultStatus)
|
||||
void changeStatus(res?._id, false)
|
||||
return res
|
||||
// Might not exist for projects with multiple task types with different statuses
|
||||
if (res != null) {
|
||||
void changeStatus(res?._id, false)
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
// We need to choose first one, since it should not be case without status.
|
||||
if (value.status === undefined) {
|
||||
void changeStatus(statuses?.[0]?._id, false)
|
||||
}
|
||||
void changeStatus(statuses?.[0]?._id, false)
|
||||
}
|
||||
|
||||
$: selectedStatus = getSelectedStatus(statuses, value, defaultIssueStatus)
|
||||
|
Loading…
Reference in New Issue
Block a user