Revert "fix #703"

This reverts commit 8996fd085a.
This commit is contained in:
keyan 2024-01-03 20:39:26 -06:00
parent 6a600c2043
commit 26e0dd6f7e
3 changed files with 6 additions and 8 deletions

View File

@ -194,7 +194,7 @@ export const muteClause = me =>
const subClause = (sub, num, table, me) => {
return sub
? `${table ? `"${table}".` : ''}"subName" = $${num}::CITEXT`
? `${table ? `"${table}".` : ''}"subName" = $${num}`
: me
? `NOT EXISTS (SELECT 1 FROM "MuteSub" WHERE "MuteSub"."userId" = ${me.id} AND "MuteSub"."subName" = ${table ? `"${table}".` : ''}"subName")`
: ''
@ -504,7 +504,6 @@ 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} value={item?.toLowerCase()}>{item}</option>)}
{item.items.map(item => <option key={item}>{item}</option>)}
</optgroup>
)
} else {
return <option key={item} value={item?.toLowerCase()}>{item}</option>
return <option key={item}>{item}</option>
}
})}
</BootstrapForm.Select>

View File

@ -64,17 +64,16 @@ export default function SubSelect ({ prependSubs, sub, onChange, appendSubs, fil
const subs = useSubs({ prependSubs, sub, filterSubs, appendSubs })
const valueProps = props.noForm
? {
value: sub?.toLowerCase()
value: sub
}
: {
overrideValue: sub?.toLowerCase()
overrideValue: sub
}
return (
<Select
onChange={onChange || ((_, e) => {
const target = e.target.selectedOptions[0].text
const sub = ['home', 'pick territory'].includes(target) ? undefined : target
const sub = ['home', 'pick territory'].includes(e.target.value) ? undefined : e.target.value
if (sub === 'create') {
router.push('/territory')
return