Skip to content

Commit e0f2047

Browse files
committed
format
1 parent d6370c1 commit e0f2047

File tree

1 file changed

+15
-8
lines changed
  • docs/3-web-servers/08-cookie/_samples/profile

1 file changed

+15
-8
lines changed

docs/3-web-servers/08-cookie/_samples/profile/main.mjs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ app.post("/login", async (request, response) => {
2424
},
2525
});
2626
if (user === undefined) {
27-
const html = index.replace("{message}", "入力されたユーザー名は存在しません。");
27+
const html = index.replace(
28+
"{message}",
29+
"入力されたユーザー名は存在しません。",
30+
);
2831
response.send(html);
2932
} else if (user.password === request.body.password) {
3033
const sessionId = await client.Session.findFirst({
@@ -49,7 +52,8 @@ app.get("/profile", async (request, response) => {
4952
const prof = await client.Profile.findUnique({
5053
where: { id: request.cookies.session },
5154
});
52-
const html = profile.replace("{name}", prof.name)
55+
const html = profile
56+
.replace("{name}", prof.name)
5357
.replace("{age}", prof.age)
5458
.replace("{univ}", prof.univ);
5559
response.send(html);
@@ -70,11 +74,11 @@ app.post("/registered", async (request, response) => {
7074
},
7175
});
7276
if (
73-
(request.body.username === "") ||
74-
(request.body.password === "") ||
75-
(request.body.name === "") ||
76-
(request.body.age === "") ||
77-
(request.body.univ === "")
77+
request.body.username === "" ||
78+
request.body.password === "" ||
79+
request.body.name === "" ||
80+
request.body.age === "" ||
81+
request.body.univ === ""
7882
) {
7983
const html = register.replace("{message}", "未記入の項目があります。");
8084
response.send(html);
@@ -102,7 +106,10 @@ app.post("/registered", async (request, response) => {
102106
const html = index.replace("{message}", "登録が完了しました。");
103107
response.send(html);
104108
} else {
105-
const html = register.replace("{message}", "入力されたユーザー名はすでに使用されています。別のユーザー名を入力してください。")
109+
const html = register.replace(
110+
"{message}",
111+
"入力されたユーザー名はすでに使用されています。別のユーザー名を入力してください。",
112+
);
106113
response.send(html);
107114
}
108115
});

0 commit comments

Comments
 (0)