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

アイテム編集ページのロジックをリポジトリを使って書き直す #31

Closed
2 tasks done
toririm opened this issue Aug 27, 2024 · 1 comment · Fixed by #39 or #34
Closed
2 tasks done

アイテム編集ページのロジックをリポジトリを使って書き直す #31

toririm opened this issue Aug 27, 2024 · 1 comment · Fixed by #39 or #34
Assignees

Comments

@toririm
Copy link
Member

toririm commented Aug 27, 2024

分割

やること

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リクエストの種類別に処理を分けて書くことを推奨したい。

@toririm
Copy link
Member Author

toririm commented Sep 3, 2024

done

@toririm toririm closed this as completed Sep 3, 2024
@toririm toririm added the backend label Sep 8, 2024
This was linked to pull requests Sep 11, 2024
@toririm toririm added the POS label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants