Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Refactor backend fix #101

Merged
merged 14 commits into from
Mar 14, 2020
Merged

Refactor backend fix #101

merged 14 commits into from
Mar 14, 2020

Conversation

reud
Copy link
Member

@reud reud commented Mar 4, 2020

TODO

  • 動作確認
  • レビュー

@reud
Copy link
Member Author

reud commented Mar 4, 2020

for @kanade9がついてるのは変更点です〜 確認次第消しといていただければ

@kanade9
Copy link
Member

kanade9 commented Mar 13, 2020

コメント全て読みました。ファイルの切り分けで何やってるかがスッキリしました

@kanade9
Copy link
Member

kanade9 commented Mar 14, 2020

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
このエラーについて修正しました。
参考
https://stackoverflow.com/questions/7042340/error-cant-set-headers-after-they-are-sent-to-the-client
https://expressjs.com/ja/guide/migrating-5.html#res.send.body

Copy link
Member Author

@reud reud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -32,7 +32,7 @@ export const GetClassDataHandler = async (
} catch (exception) {
console.log("class not found probably wrong or empty query");
console.log(exception);
resp.sendStatus(404).send("Not Found");
resp.sendStatus(404);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resp.sendStatus(404)で主にレスポンス送ってるのにさらに.send("Not Found");って書いてるのがダメだったぽいね!
一括で書き換えしてたので修正漏れていました。ありがとうございます!

return;
}
resp.sendStatus(200).send(JSON.stringify(qss.data()));
resp.send(JSON.stringify(qss.data()));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kanade9
この場合、ステータスコードって200になってる?
なるならそのままでおkですが、ならないなら
resp.status(200).send(JSON.stringify(qss.data()));
にする必要がありそうです。確認お願いします!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正しました!

@kanade9
Copy link
Member

kanade9 commented Mar 14, 2020

修正したのでマージします!!

@kanade9 kanade9 merged commit 72ccc2c into backend_fix Mar 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants