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

特定ユーザ取得APIの実装 #70

Merged
merged 14 commits into from
Sep 10, 2024
Merged

Conversation

eraser5th
Copy link
Contributor

close #41

特定ユーザ取得APIを実装した。

実装時にget_user_by_idの返り値の型を Result<User, ()> から Result<Option<User, ()>>に変更。
理由:Not foundとInternal server errorの判別のため
これに伴いテストの軽い修正が入っている。

見つからなかった場合(404)とDBでエラーが発生した場合(Internal server error)を別で扱いたいのでResult<User>からResult<Option<User>>に変更
これに伴いテストの軽い修正(テストしたい振る舞い自体は変わらないうえ軽い修正なので一緒にやった)
@eraser5th eraser5th changed the base branch from main to story/#35 August 19, 2024 07:32
@eraser5th eraser5th marked this pull request as ready for review August 19, 2024 07:33
モックの場合find_by_idで渡したidと一致しなくても最初の要素が返ってきてしまうためからのVectorに変更した
updated_atをオプショナルにした
user方が変更されたので修正
Copy link
Collaborator

@noharu36 noharu36 left a comment

Choose a reason for hiding this comment

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

Makefile, db, nix周りはわからないけど、API部分は問題なさそうです!

Copy link
Collaborator

@noharu36 noharu36 left a comment

Choose a reason for hiding this comment

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

LGTM

@noharu36 noharu36 merged commit c76ad8c into story/#35 Sep 10, 2024
3 checks passed
@noharu36 noharu36 deleted the ticket/#41-get-user-api branch September 10, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

特定ユーザの情報取得機能のAPIを書く
2 participants