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

🐢 ユーザ削除機能 #183

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

🐢 ユーザ削除機能 #183

wants to merge 5 commits into from

Conversation

whooolemilk
Copy link
Contributor

@whooolemilk whooolemilk commented Sep 2, 2022

💫 関連Issues

close #162

💪🏻 変更したこと

  • ButtonDeleteUserの作成
  • ごめん鬼ほど眠くてちからつk

👀 確認項目

  • サイドメニューから削除できるか見てくださイ
  • TODO: サブコレクションの実装は時間かかりそうなので別で実装したイ

@whooolemilk whooolemilk added the Review Required 完了したらこれつける label Sep 2, 2022
@whooolemilk whooolemilk self-assigned this Sep 2, 2022
@whooolemilk whooolemilk changed the title ユーザ削除機能 🐢 ユーザ削除機能 Sep 2, 2022
Copy link
Member

@k1tikurisu k1tikurisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全体的に、前回プルリク(#182)の変更を取り消すような差分がいっぱい入ってるんやけど、なんでやろ
いっかいmain取り込んで、mainを優先するようにコンフリクト解消してほしい!

Comment on lines +21 to +38

try {
await deleteDoc(usersRef)
} catch (e) {
console.error(e)
}

try {
travelinkDocs.forEach(async (travelinkDoc) => {
const travelinkRef = doc(
collection(db, 'travelinks'),
travelinkDoc.data().id
)
await deleteDoc(travelinkRef)
})
} catch (e) {
console.error(e)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こういう二つの処理を同時にする時は、どっちか成功して片方失敗した時にデータに不整合おきるから、トランザクションで囲って、片方失敗した時は両方失敗になるような実装にしたい.
下の記事読んでないけど、firestoreのトランザクションで調べてみてほし
https://zenn.dev/yucatio/articles/7c4ba0d0138ca9

Comment on lines +56 to +62
</Button>
<Button
colorScheme="alertRed"
size="md"
w={'5rem'}
h={'3rem'}
onClick={() => onClickDeleteUser(id)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cssは、中括弧にシングルくォーテーションで統一したいclolorScheme={'alertRed'}みたいな

@k1tikurisu k1tikurisu added Logic and removed Review Required 完了したらこれつける labels Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

アカウント削除機能
2 participants