core&ui: add new features about domain (#528)

Co-authored-by: undefined <i@undefined.moe>

- Add navigation hint
- Update homework/contest filter by assign
- Allow empty query for DomainSelectAutoComplete
This commit is contained in:
panda authored and GitHub committed 2023-03-12 22:45:23 +08:00
1 parent 9fb85300e7
commit 3581ccb065
12 files changed
+129 -35

No files matched your search

@@ -1,5 +1,4 @@
import { NotFoundError } from '../../error';
import avatar from '../../lib/avatar';
import { PERM } from '../../model/builtin';
import UserModel from '../../model/user';
import type { KoaContext } from '../server';
@@ -15,7 +14,6 @@ export default async (ctx: KoaContext, next) => {
user = await UserModel.getById(domainId, ctx.session.uid, ctx.session.scope);
}
if (user._id === 0) delete user.viewLang;
user.avatarUrl = avatar(user.avatar, 128);
ctx.HydroContext.user = await user.private();
if (!domain) {
ctx.pendingError = new NotFoundError(args.domainId);