fix undefined sub on post pre-form
This commit is contained in:
parent
4c1ef62386
commit
19835aef5f
@ -30,8 +30,16 @@ export default function SubSelect ({ label, sub, setSub, item, ...props }) {
|
|||||||
</Info>
|
</Info>
|
||||||
)
|
)
|
||||||
|
|
||||||
sub ||= router.query.sub
|
sub ||= router.query.sub || 'pick sub'
|
||||||
const extraProps = props.noForm ? { value: sub } : { overrideValue: sub }
|
const extraProps = props.noForm
|
||||||
|
? {
|
||||||
|
value: sub,
|
||||||
|
items: ['pick sub', ...SUBS]
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
overrideValue: sub,
|
||||||
|
items: item ? SUBS_NO_JOBS : ['pick sub', ...SUBS_NO_JOBS]
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Select
|
<Select
|
||||||
@ -49,7 +57,6 @@ export default function SubSelect ({ label, sub, setSub, item, ...props }) {
|
|||||||
name='sub'
|
name='sub'
|
||||||
size='sm'
|
size='sm'
|
||||||
{...extraProps}
|
{...extraProps}
|
||||||
items={props.noForm ? ['pick sub', ...SUBS] : item ? SUBS_NO_JOBS : ['pick sub', ...SUBS_NO_JOBS]}
|
|
||||||
label={label &&
|
label={label &&
|
||||||
<>
|
<>
|
||||||
{label}
|
{label}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user