Open
Conversation
hikahana
commented
Feb 3, 2025
| WHERE id = (SELECT id FROM reach_logs ORDER BY created_at DESC LIMIT 1); | ||
| END; | ||
| $$; | ||
| CREATE FUNCTION public.insert_prize_with_image(p_is_won boolean, p_name_jp text, p_name_en text, p_bucket_name text, p_file_name text, p_file_type text) RETURNS SETOF public.prizes |
| metaData, | ||
| ); | ||
| return res.status(200).json({ message: "Upload successful" }); | ||
| return res.status(200).json({ |
Collaborator
Author
There was a problem hiding this comment.
ここレスポンスで取得できそうだったから返してる
| CreateOneImageMutationVariables | ||
| >(CreateOneImageDocument); | ||
|
|
||
| const bingoPrizes: GetListPrizesQuery["prizes"] = data?.prizes ?? []; |
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.
対応Issue
なし!
概要
今までは
minioへ画像送信
insertImageを実行
insertPrizeを実行
としていたが
insert部分を一括で行うようにfunctionを作成した。
minio部分は修正不可な感じだったので放置
実装詳細
新たにcreate_prize_with_image functionを作成
ここでprize,imageを一括でpostするようにしている。
失敗時に何もデータが追加されないはず
pages/postPrizeのリファクタも行った。
カスタムフックだからuseEffectを使ってdata.prizesを格納するのは二度手間であるため修正した。
画面スクリーンショット等
テスト項目
備考
down -vしてください!
関数部分はgptとコネコネしてたから変かも