This commit is contained in:
keyan 2024-01-03 16:12:33 -06:00
parent 717f8d1ef6
commit 8996fd085a
3 changed files with 8 additions and 6 deletions

View File

@ -194,7 +194,7 @@ export const muteClause = me =>
const subClause = (sub, num, table, me) => {
return sub
? `${table ? `"${table}".` : ''}"subName" = $${num}`
? `${table ? `"${table}".` : ''}"subName" = $${num}::CITEXT`
: me
? `NOT EXISTS (SELECT 1 FROM "MuteSub" WHERE "MuteSub"."userId" = ${me.id} AND "MuteSub"."subName" = ${table ? `"${table}".` : ''}"subName")`
: ''
@ -504,6 +504,7 @@ export default {
}
break
}
return {
cursor: items.length === limit ? nextCursorEncoded(decodedCursor) : null,
items,

View File

@ -855,11 +855,11 @@ export function Select ({ label, items, groupClassName, onChange, noForm, overri
if (item && typeof item === 'object') {
return (
<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>
)
} else {
return <option key={item}>{item}</option>
return <option key={item} value={item.toLowerCase()}>{item}</option>
}
})}
</BootstrapForm.Select>

View File

@ -64,16 +64,17 @@ export default function SubSelect ({ prependSubs, sub, onChange, appendSubs, fil
const subs = useSubs({ prependSubs, sub, filterSubs, appendSubs })
const valueProps = props.noForm
? {
value: sub
value: sub.toLowerCase()
}
: {
overrideValue: sub
overrideValue: sub.toLowerCase()
}
return (
<Select
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') {
router.push('/territory')
return