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

Fix bug where newly created tags were not added to store #1709

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

richardolsson
Copy link
Member

Description

This PR fixes an undocumented bug introduced by the hook refactor, which caused new tags to not be added to the store, which in turn meant that they would not show up in tag lists until the user refreshes the page (or the cache is invalidated after five minutes). This only happened to ungrouped tags, due to a forgotten comment. Grouped tags still worked as expected.

Screenshots

None

Changes

  • Adds dispatching of actions when creating ungrouped tags

Notes to reviewer

None

Related issues

Undocumented

const tagFuture = await apiClient
.post<ZetkinTag, ZetkinTagPostBody>(
`/api/orgs/${orgId}/people/tags`,
tag
)
.then((data: ZetkinTag) => {
// dispatch(tagGroupCreated);
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't believe I left this 😨 Thanks for catching this!!

@kaulfield23 kaulfield23 merged commit ce7b4cc into main Dec 14, 2023
4 checks passed
@kaulfield23 kaulfield23 deleted the undocumented/create-tag-bug branch December 14, 2023 16:12
@kaulfield23
Copy link
Contributor

Tested it and it works as I expected!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants