Skip to content

Conversation

@riona-k
Copy link
Contributor

@riona-k riona-k commented Dec 8, 2025

await apiPost('/tags.update', updateTagsData);
if (pageId != null) {
await mutate(key => JSON.stringify(key).includes(pageId), undefined, { revalidate: true });
}
Copy link
Member

Choose a reason for hiding this comment

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

  • これだと何が mutate されているか分かりにくいです
  • String.prototype.includes() だと意図しないキーがマッチして無駄な再検証が走る可能性があります (本来やりたいことは tag の再検証のみ)
  • useSWRxTagsInfo から提供される mutate を使って実装してみてほしいです
    • updateStateAfterSave の中に mutate に実装しても良さそうです

@riona-k riona-k force-pushed the fix/tag-edit-modal-update branch from 52b6953 to 8405d83 Compare December 8, 2025 09:12
await apiPost('/tags.update', updateTagsData);
if (mutateTags != null) {
await mutateTags();
}
Copy link
Member

@miya miya Dec 10, 2025

Choose a reason for hiding this comment

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

mutateTags って nullable じゃなさそうなので null check は不要そう

Copy link
Member

@miya miya Dec 10, 2025

Choose a reason for hiding this comment

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

あと、これは非同期でも良さそうなので await もいらないかも (更新が成功したら即時トースターをだしたいので)

@yuki-takei yuki-takei merged commit 390e70c into dev/7.4.x Dec 12, 2025
16 checks passed
@yuki-takei yuki-takei deleted the fix/tag-edit-modal-update branch December 12, 2025 09:22
@github-actions github-actions bot mentioned this pull request Dec 12, 2025
@github-actions github-actions bot mentioned this pull request Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants