This commit is contained in:
2022-03-31 12:25:54 +08:00
parent 7e4c106683
commit a67715a2a0
7 changed files with 38 additions and 37 deletions

View File

@@ -41,10 +41,10 @@ const updateUsernameWithLimit = db.transaction((username, id, limit) => {
const count = countUser.get(username).count;
const existingUsername = getUsername.get(id).username;
if (existingUsername !== "") {
throw new Error("Username already exists");
throw new Error("这个时间段已经有人了喔");
}
if (count >= limit) {
throw new Error("Limit reached");
throw new Error("达到数量上限啦");
}
updateUsername.run(username, id);
});