Open
Conversation
68ff647 to
f0b6918
Compare
f0b6918 to
5ea1da9
Compare
Contributor
Author
|
フロント側と合わせる必要があるので、マージせずにコードだけ確認してもらえると、嬉しいです。 |
tekihei2317
reviewed
Sep 6, 2023
Collaborator
tekihei2317
left a comment
There was a problem hiding this comment.
コードを確認しました!
いくつかコメントしたので、フロント実装の際に確認していただければと思います!
server/_mypage/update-profile.ts
Outdated
| if (user.imageId) { | ||
| await deleteImageInCloudinary(user.imageId); | ||
| } | ||
| const imageId = await uploadImageToCloudinary(input?.profileImage); |
Collaborator
There was a problem hiding this comment.
inputにプロフィール画像がある場合だけアップロードする必要がありそうです!
server/_mypage/update-profile.ts
Outdated
| /** | ||
| * マイページの情報を更新する | ||
| */ | ||
| export const updateProfile = protectedProcedure.input(MypageInput).query(async ({ ctx, input }) => { |
Collaborator
There was a problem hiding this comment.
更新系のAPIはmutationで定義するのが良いかと思います!
| value: z.string().url({ message: ERROR_INVALID_URL }).max(191, { message: ERROR_MAX_LENGTH }), | ||
| }) | ||
| ), | ||
| profileImage: z.string().optional(), |
Collaborator
There was a problem hiding this comment.
フロント側ではファイルを受け取るので、繋ぎ込みの際に前の記述(z.custom<FileList>()...)に戻す必要があるかもです。
現状はフロントとサーバー側は別のスキーマを使っているので、こちらもそうするか、あるいはz.mergeなどを使って差分だけ上書きしても良いかもしれません。
b7011c4 to
77e0e3c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PRの内容
マイページ画面のAPIを作成
動作確認方法
以下のような感じでpostmanとかでpostしてもらえれば!
その他連絡事項