Skip to content

Commit

Permalink
cleanup todos
Browse files Browse the repository at this point in the history
  • Loading branch information
arily committed Apr 28, 2024
1 parent 46c55e2 commit 51cc93c
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/components/userpage/statistics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ const ScoreToNextLevel = computed(
: "Score"
}}
</div>
<!-- TODO add popover -->
<div class="stat-value font-mono">
<!-- <Roller
:char-set="chars"
Expand Down
1 change: 1 addition & 0 deletions src/def/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export enum GucchoError {
UserNotFound = 2000,
UserExists,
ConflictEmail,
EmptyPassword,
UpdateUserSettingsFailed,
UpdateUserpageFailed,
MimeNotImage,
Expand Down
1 change: 1 addition & 0 deletions src/locales/base/en-GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export default {
[GucchoError.EmailTokenNotFound]: 'Email verification token has expired.',
[GucchoError.InvalidId]: 'ID Invalid',
[GucchoError.BeatmapNotFound]: 'Beatmap not found',
[GucchoError.EmptyPassword]: 'Password cannot be empty',
},
country: {
[CountryCode.Unknown]: 'Unknown',
Expand Down
1 change: 1 addition & 0 deletions src/locales/base/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export default {
[GucchoError.RequireAdminPrivilege]: '需要管理员权限',
[GucchoError.InvalidId]: 'ID不合法',
[GucchoError.BeatmapNotFound]: '找不到图',
[GucchoError.EmptyPassword]: '密码不能为空',
},

country: {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/auth/account-recovery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ zh-CN:
done: 完成
succeed-message: 密码重置成功!

# TODO check translation
# TODO fr translation
fr-FR:
invalid-otp: Invalid OTP
</i18n>
Expand Down
6 changes: 0 additions & 6 deletions src/server/backend/bancho.py/db-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ export function createUserLikeQuery(keyword: string) {
: {
id: idKw,
},
// TODO: search by email after preferences implemented
// {
// email: {
// contains: keyword,
// },
// },
].filter(TSFilter),
},
}
Expand Down
1 change: 0 additions & 1 deletion src/server/backend/[email protected]/server/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export class UserProvider extends BanchoPyUser implements Base<Id, ScoreId> {
user.roles.push(UserRole.Supporter)
}

// TODO: check email(should verified by frontend with another request (not impl'd yet ))
const updatedUser = await super.changeSettings(user, input)
return updatedUser
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/trpc/routers/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ export const router = _router({
repeatPassword: string(),
token: zodEmailValidation,
}))
.mutation(async ({ ctx, input }) => {
.mutation(async ({ input }) => {
if (!input.password) {
// TODO refine error message
throwGucchoError(GucchoError.UpdateUserSettingsFailed)
throwGucchoError(GucchoError.EmptyPassword)
}
if (input.password !== input.repeatPassword) {
throwGucchoError(GucchoError.PasswordNotMatch)
Expand Down
1 change: 1 addition & 0 deletions src/server/utils/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export function createGucchoError(code: GucchoError): TRPCError {
}

case GucchoError.DeletingMoreThanOneAvatars:
case GucchoError.EmptyPassword:
case GucchoError.InvalidId:
case GucchoError.HackerTryingToDeleteAllAvatars: {
return new TRPCError(merge({ code: 'BAD_REQUEST' }))
Expand Down

0 comments on commit 51cc93c

Please sign in to comment.