We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
app/routes/items.tsx
のロジック部分(clientAction)を
clientAction
import { itemRepository } from '~/repositories/item';
を使って書き直す。
そんなに難しくない
Note
異なる操作(新規作成, 削除, 更新, etc)を実現するエンドポイントとして clientActionが不足する場合がある。
デフォルトでは、ページ内のPOST, PUT, DELETEが すべて同エンドポイントのclientActionに向く。
POST, PUT, DELETE
この場合、他のエンドポイント(e.g. app/routes/foo.tsx)にclientActionを作成して <Form action="/foo"> と向けることもできるが
app/routes/foo.tsx
<Form action="/foo">
ここでは、app/routes/orders.tsxで採用しているような HTTPリクエストの種類別に処理を分けて書くことを推奨したい。
app/routes/orders.tsx
The text was updated successfully, but these errors were encountered:
/items
done
Sorry, something went wrong.
Lailai0477
Successfully merging a pull request may close this issue.
分割
やること
app/routes/items.tsx
のロジック部分(
clientAction
)をimport { itemRepository } from '~/repositories/item';
を使って書き直す。
難易度
そんなに難しくない
できたらやること
Note
異なる操作(新規作成, 削除, 更新, etc)を実現するエンドポイントとして
clientActionが不足する場合がある。
デフォルトでは、ページ内の
POST, PUT, DELETE
がすべて同エンドポイントのclientActionに向く。
この場合、他のエンドポイント(e.g.
app/routes/foo.tsx
)にclientActionを作成して<Form action="/foo">
と向けることもできるがここでは、
app/routes/orders.tsx
で採用しているようなHTTPリクエストの種類別に処理を分けて書くことを推奨したい。
The text was updated successfully, but these errors were encountered: