fix #703
This commit is contained in:
parent
717f8d1ef6
commit
8996fd085a
|
@ -194,7 +194,7 @@ export const muteClause = me =>
|
||||||
|
|
||||||
const subClause = (sub, num, table, me) => {
|
const subClause = (sub, num, table, me) => {
|
||||||
return sub
|
return sub
|
||||||
? `${table ? `"${table}".` : ''}"subName" = $${num}`
|
? `${table ? `"${table}".` : ''}"subName" = $${num}::CITEXT`
|
||||||
: me
|
: me
|
||||||
? `NOT EXISTS (SELECT 1 FROM "MuteSub" WHERE "MuteSub"."userId" = ${me.id} AND "MuteSub"."subName" = ${table ? `"${table}".` : ''}"subName")`
|
? `NOT EXISTS (SELECT 1 FROM "MuteSub" WHERE "MuteSub"."userId" = ${me.id} AND "MuteSub"."subName" = ${table ? `"${table}".` : ''}"subName")`
|
||||||
: ''
|
: ''
|
||||||
|
@ -504,6 +504,7 @@ export default {
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
cursor: items.length === limit ? nextCursorEncoded(decodedCursor) : null,
|
cursor: items.length === limit ? nextCursorEncoded(decodedCursor) : null,
|
||||||
items,
|
items,
|
||||||
|
|
|
@ -855,11 +855,11 @@ export function Select ({ label, items, groupClassName, onChange, noForm, overri
|
||||||
if (item && typeof item === 'object') {
|
if (item && typeof item === 'object') {
|
||||||
return (
|
return (
|
||||||
<optgroup key={item.label} label={item.label}>
|
<optgroup key={item.label} label={item.label}>
|
||||||
{item.items.map(item => <option key={item}>{item}</option>)}
|
{item.items.map(item => <option key={item} value={item.toLowerCase()}>{item}</option>)}
|
||||||
</optgroup>
|
</optgroup>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
return <option key={item}>{item}</option>
|
return <option key={item} value={item.toLowerCase()}>{item}</option>
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</BootstrapForm.Select>
|
</BootstrapForm.Select>
|
||||||
|
|
|
@ -64,16 +64,17 @@ export default function SubSelect ({ prependSubs, sub, onChange, appendSubs, fil
|
||||||
const subs = useSubs({ prependSubs, sub, filterSubs, appendSubs })
|
const subs = useSubs({ prependSubs, sub, filterSubs, appendSubs })
|
||||||
const valueProps = props.noForm
|
const valueProps = props.noForm
|
||||||
? {
|
? {
|
||||||
value: sub
|
value: sub.toLowerCase()
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
overrideValue: sub
|
overrideValue: sub.toLowerCase()
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Select
|
<Select
|
||||||
onChange={onChange || ((_, e) => {
|
onChange={onChange || ((_, e) => {
|
||||||
const sub = ['home', 'pick territory'].includes(e.target.value) ? undefined : e.target.value
|
const target = e.target.selectedOptions[0].text
|
||||||
|
const sub = ['home', 'pick territory'].includes(target) ? undefined : target
|
||||||
if (sub === 'create') {
|
if (sub === 'create') {
|
||||||
router.push('/territory')
|
router.push('/territory')
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue