-
Notifications
You must be signed in to change notification settings - Fork 0
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
デプロイ時に出た修正をここにまとめる #289
デプロイ時に出た修正をここにまとめる #289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
エラーだけ確認しました。
ローカルでminioへの画像追加ができないんですが、できてますか?
import { Header, PrizeResult, Loading } from "@/components/common"; | ||
import { IoCloudUploadOutline } from "react-icons/ios"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
読み込み先は/io5
ですね。
import { IoCloudUploadOutline } from "react-icons/ios"; | |
import { IoCloudUploadOutline } from "react-icons/io5"; |
@@ -26,13 +26,12 @@ const Page: NextPage = () => { | |||
); | |||
const [prizeNameJp, setPrizeNameJp] = useState<string>(""); | |||
const [prizeNameEn, setPrizeNameEn] = useState<string>(""); | |||
const fileInputRef = useRef<HTMLInputElement>(null); | |||
const [imageFile, setImageFile] = useState<File | null>(null); | |||
const fileInputRef = useRef<HTMLInputElement>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null
入れないとエラー出ませんか?
const fileInputRef = useRef<HTMLInputElement>(); | |
const fileInputRef = useRef<HTMLInputElement>(null); |
bucketNameにendpoint入れてました。。。。。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
私のローカル環境でMinIOへのPOSTが動作しなかったため、コメントしたように修正したところ動作しました。そちらの環境ではどうでしょうか?
view-admin/src/pages/api/minio.ts
Outdated
if (req.method === "POST") { | ||
const form = formidable(); | ||
|
||
form.parse(req, async (err: any, fields: any, files: any) => { | ||
form.parse(req, async (err: any, files: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parse
メソッドは第3引数にファイルデータを渡すようなので、使用しない引数も挟まないと動作しないと思われます。
parse<FieldKey extends string, FileKey extends string>(
request: IncomingMessage,
): Promise<[Fields<FieldKey>, Files<FileKey>]>;
parse<FieldKey extends string, FileKey extends string>(
request: IncomingMessage,
callback?: (err: any, fields: Fields<FieldKey>, files: Files<FileKey>) => void,
): void;
form.parse(req, async (err: any, files: any) => { | |
form.parse(req, async (err: any, _: Fields, files: Files) => { |
型もany型はできるだけ避けて下記みたいな感じで!
import formidable, { Fields, Files } from "formidable";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
治しました
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
対応Issue
なし、
概要
デプロイ時に発生した修正をここにまとめています。
キックオフ後マージ予定です。
実装詳細
minioの送信を修正
タイポの修正
prod用のmakeの修正
画面スクリーンショット等
テスト項目
備考