mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: assignment auto complete (#1061)
This commit is contained in:
1 parent
f32cee2200
commit
564ff1b02d
6 files changed
+184
-8
No files matched your search
@@ -433,6 +433,25 @@ export const DomainApi = {
|
||||
return ddoc;
|
||||
},
|
||||
),
|
||||
groups: Query(
|
||||
Schema.object({
|
||||
search: Schema.string(),
|
||||
names: Schema.array(Schema.string()),
|
||||
domainId: Schema.string().required(),
|
||||
}),
|
||||
async (ctx, args) => {
|
||||
if (!ctx.user.hasPerm(PERM.PERM_VIEW) && !ctx.user.hasPriv(PRIV.PRIV_VIEW_ALL_DOMAIN)) throw new PermissionError(PERM.PERM_VIEW);
|
||||
const groups = await user.listGroup(args.domainId);
|
||||
if (args.names?.length) {
|
||||
return groups.filter((g) => args.names.includes(g.name));
|
||||
}
|
||||
if (args.search) {
|
||||
const searchLower = args.search.toLowerCase();
|
||||
return groups.filter((g) => g.name.toLowerCase().includes(searchLower));
|
||||
}
|
||||
return groups;
|
||||
},
|
||||
),
|
||||
'domain.group': Mutation(
|
||||
Schema.object({
|
||||
name: Schema.string().required(),
|
||||
|
||||
Reference in new issue
Block a user