Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

コンソールエラーの削除 #235

Merged
merged 8 commits into from
Oct 22, 2024
5 changes: 3 additions & 2 deletions pong/pong/static/pong/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export async function getUuid() {
credentials: "include",
});
const data = await response.json();
console.log(data);
if (!response.ok) {
throw new Error(data.message || "Failed to verify token");
}
Expand All @@ -25,7 +24,6 @@ export async function getUserFromUuid(uuid) {
credentials: "include",
});
const data = await response.json();
console.log(data);
if (!response.ok) {
throw new Error(data.message || "Failed to fetch user data");
}
Expand All @@ -38,6 +36,9 @@ export async function getUserFromUuid(uuid) {

export async function getUsersDataFromName(name) {
try {
if (!name) {
return null;
}
const response = await fetch(`/pong/api/v1/users/search/${name}`, {
method: "GET",
headers: { "Content-Type": "application/json" },
Expand Down
3 changes: 2 additions & 1 deletion pong/pong/static/pong/components/Edit2FA.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class Edit2FA extends Component {
const formHTML = `
<form class="totp-form">
<label for="totp-code">6桁の認証コード:</label>
<input type="text" class="totp-code" name="totp-code" maxlength="6" required>
<input type="text" id="totp-code" class="totp-code" name="totp-code" maxlength="6" required>
<br><br>
<button type="submit">送信</button>
</form>
Expand Down Expand Up @@ -106,6 +106,7 @@ export class Edit2FA extends Component {
<button class="generate-qrcode" type="submit">二要素認証アプリケーション用QRコードを取得する</button>
<div class="qrcode-container"></div>
<div class="totp-fom-container"></div>
<button class="back-button" type="button" onclick="history.back()">戻る</button>
`;
}
}
2 changes: 1 addition & 1 deletion pong/pong/static/pong/components/EditProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class EditProfile extends Component {
<form class="edit-profile-form">
<label for="username">Username</label>
<input type="text" placeholder="username" id="username" name="name"><br/>
<label for="Nick">Nickname</label>
<label for="nickname">Nickname</label>
<input type="text" placeholder="nickname" id="nickname" name="nickname"><br/>
<label for="email">Email</label>
<input type="email" placeholder="email" id="email" name="email"><br/>
Expand Down
2 changes: 1 addition & 1 deletion pong/pong/static/pong/components/PongGameHome.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class PongGameHome extends Component {
</div>
<div class="number-of-players-selector-container p-3">
<label for="number-of-players-selector">Select Number of Players: <label>
<select name="number-of-players-selector" id="number-of-players-selecor" class="form-select">
<select name="number-of-players-selector" id="number-of-players-selector" class="form-select">
<option value="2" selected>2</option>
<option value="4">4</option>
</select>
Expand Down
3 changes: 1 addition & 2 deletions pong/pong/static/pong/core/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ export class Router {
}

if (path !== "/signin" && path !== "/signup" && path !== "/totp") {
this.verifyAndRefreshToken().catch((error) => {
console.log(error);
this.verifyAndRefreshToken().catch(() => {
path = "/signin";
route = this.searchRouteFromPath("/signin");
let component = new route.component(
Expand Down
4 changes: 0 additions & 4 deletions pong/pong/views/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@ def searched_users(request, name):
)

users = User.objects.filter(name__icontains=name)
if not users:
return JsonResponse(
{"message": "Users not found", "status": "userNotFound"}, status=404
)
hitted_user_list = []
for user in users:
friend_status = "stranger"
Expand Down