plugins: typer:username now supports multiple:true

Massimo Melina committed Jun 10, 2024 at 00:13 UTC c8b68908cca1f7d7a0a4e26e15642e9bc266d05a
1 file changed +2 -2
admin/src/InstalledPlugins.ts
+2 -2
@@ -191,9 +191,9 @@ export async function startPlugin(id: string) {
191 }
192 }
193
194 -function UsernameField({ value, onChange, ...rest }: FieldProps<string>) {
194 +function UsernameField({ value, onChange, multiple, ...rest }: FieldProps<string>) {
195 const { data, element, loading } = useApiEx<{ list: Account[] }>('get_accounts')
196 - return !loading && element || h(SelectField as Field<string>, {
196 + return !loading && element || h((multiple ? MultiSelectField : SelectField) as Field<string>, {
197 value, onChange,
198 options: data?.list.map(x => x.username),
199 helperText: "Only users, no groups here",