mirror of
https://github.com/captbaritone/webamp.git
synced 2026-08-03 15:34:25 +00:00
Fix resolver bugs uncovered by test
This commit is contained in:
parent
63bdd3efa6
commit
4bdb243933
2 changed files with 8 additions and 4 deletions
|
|
@ -76,6 +76,9 @@ class RootResolver extends MutationResolver {
|
|||
return new SkinsConnection(first, offset, sort, filter);
|
||||
}
|
||||
async skin_to_review(_args, { ctx }) {
|
||||
if (!ctx.authed()) {
|
||||
return null;
|
||||
}
|
||||
const { md5 } = await Skins.getSkinToReview();
|
||||
const model = await SkinModel.fromMd5Assert(ctx, md5);
|
||||
return new SkinResolver(model);
|
||||
|
|
@ -90,7 +93,7 @@ class RootResolver extends MutationResolver {
|
|||
return new UserResolver();
|
||||
}
|
||||
async upload_statuses_by_md5({ md5s }, { ctx }) {
|
||||
return this._upload_statuses({ keyName: "md5", keys: md5s }, ctx);
|
||||
return this._upload_statuses({ keyName: "skin_md5", keys: md5s }, ctx);
|
||||
}
|
||||
|
||||
async upload_statuses({ ids }, { ctx }) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import UserContext from "../../../data/UserContext";
|
||||
|
||||
export default class UserResolver {
|
||||
username(_args, ctx) {
|
||||
// For now every user is the current user.
|
||||
return ctx.user?.username;
|
||||
username(_args, { ctx }) {
|
||||
return ctx.username;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue