Skip to content

Commit

Permalink
Merge pull request #133 from softeerbootcamp4th/feature/122-admin-user
Browse files Browse the repository at this point in the history
[fix] 긴급수정
  • Loading branch information
lybell-art authored Aug 22, 2024
2 parents 54085f8 + 9f766d5 commit aba101f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/adminPage/features/comment/id/Comments.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export default function Comments({
return res;
})
.catch((e) => {
alert("통신 오류로 기대평 로드 실패.");
console.log(e);
return { comments: [] };
}),
[page, searchString],
);
Expand Down
2 changes: 2 additions & 0 deletions src/adminPage/features/users/Users.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export default function Comments({ searchString, category }) {
return res;
})
.catch((e) => {
alert("통신 오류로 유저 목록 로드 실패.")
console.log(e);
return { users: [] };
}),
[page, searchString],
);
Expand Down
2 changes: 1 addition & 1 deletion src/mainPage/features/fcfs/cardGame/CardGame.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function CardGame({ offline }) {
}

async function getCardAnswerOnline(index) {
const fetchConfig = { method: "post", body: { eventAnswer: index } };
const fetchConfig = { method: "post", body: { answer: index } };
try {
const { answerResult, winner } = await fetchServer(
`/api/v1/event/fcfs/${EVENT_FCFS_ID}`,
Expand Down
6 changes: 3 additions & 3 deletions src/mainPage/features/fcfs/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ const handlers = [
return HttpResponse.json(false);
}),
http.post("/api/v1/event/fcfs/:eventFrameId", async ({ request }) => {
const { eventAnswer } = await request.json();
const { answer } = await request.json();

const answerResult = eventAnswer === 3;
const answerResult = answer === 3;
const winner = false;

const token = request.headers.get("authorization");
if (token === null) return HttpResponse.json(false, { status: 401 });

if (typeof eventAnswer !== "number") return HttpResponse.json(false, { status: 400 });
if (typeof answer !== "number") return HttpResponse.json(false, { status: 400 });

return HttpResponse.json({ answerResult, winner });
}),
Expand Down
3 changes: 2 additions & 1 deletion src/mainPage/shared/auth/UserFind/requestLogin.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { fetchServer, handleError } from "@common/dataFetch/fetchServer.js";
import { EVENT_ID } from "@common/constants";

async function requestLogin(name, phoneNumber) {
try {
const body = { name, phoneNumber: phoneNumber.replace(/\D+/g, "") };
const { token } = await fetchServer("/api/v1/event-user/login", {
const { token } = await fetchServer(`/api/v1/event-user/login/${EVENT_ID}`, {
method: "post",
body,
});
Expand Down
4 changes: 2 additions & 2 deletions src/mainPage/shared/auth/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const token =
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ0ZWFtLW9yYW5nZSIsImlhdCI6MTcyNDA0NDc5MCwiZXhwIjoxNzI0MDQ4MzkwLCJzdWIiOiJldmVudFVzZXIiLCJ1c2VyTmFtZSI6Iuq5gOyCoeu6qSIsInVzZXJJZCI6ImtpbXBpcHB5YXAiLCJyb2xlIjoiZXZlbnRfdXNlciJ9.m5m_PkwmYz5Mt-kjn28435bQtwgph3WO-2J42X82lCg";

const handlers = [
http.post("/api/v1/event-user/send-auth", async ({ request }) => {
http.post("/api/v1/event-user/send-auth/:eventFrameId", async ({ request }) => {
const { name, phoneNumber } = await request.json();
if (phoneNumber === "01019991999")
return HttpResponse.json({ error: "중복된 사용자가 있음" }, { status: 409 });
Expand All @@ -28,7 +28,7 @@ const handlers = [
return HttpResponse.json({ token });
}),

http.post("/api/v1/event-user/login", async ({ request }) => {
http.post("/api/v1/event-user/login/:eventFrameId", async ({ request }) => {
const { name, phoneNumber } = await request.json();

if (!isValidInput(name, phoneNumber))
Expand Down

0 comments on commit aba101f

Please sign in to comment.