-
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
🐢 ユーザ削除機能 #183
base: main
Are you sure you want to change the base?
🐢 ユーザ削除機能 #183
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.
全体的に、前回プルリク(#182)の変更を取り消すような差分がいっぱい入ってるんやけど、なんでやろ
いっかいmain取り込んで、mainを優先するようにコンフリクト解消してほしい!
|
||
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) | ||
} |
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.
こういう二つの処理を同時にする時は、どっちか成功して片方失敗した時にデータに不整合おきるから、トランザクションで囲って、片方失敗した時は両方失敗になるような実装にしたい.
下の記事読んでないけど、firestoreのトランザクションで調べてみてほし
https://zenn.dev/yucatio/articles/7c4ba0d0138ca9
</Button> | ||
<Button | ||
colorScheme="alertRed" | ||
size="md" | ||
w={'5rem'} | ||
h={'3rem'} | ||
onClick={() => onClickDeleteUser(id)} |
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.
cssは、中括弧にシングルくォーテーションで統一したいclolorScheme={'alertRed'}
みたいな
💫 関連Issues
close #162
💪🏻 変更したこと
👀 確認項目