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 topic being removed from folder on edit #745

Merged
merged 4 commits into from
Jan 29, 2024

Conversation

thecalcc
Copy link
Contributor

@thecalcc thecalcc commented Jan 24, 2024

CPCN-562

Checklist

  • This pull request is not adding new forms that use redux
  • This pull request is adding missing TypeScript types to modified code segments where it's easy to do so with confidence
  • This pull request is replacing lodash.get with optional chaining for modified code segments

@thecalcc thecalcc requested a review from tomaskikutis January 24, 2024 14:48
@tomaskikutis
Copy link
Member

What was the cause of the issue?

@petrjasek petrjasek added this to the v2.6 milestone Jan 25, 2024
@thecalcc
Copy link
Contributor Author

What was the cause of the issue?

We were updating the topic regardless if one was created in the topic editor or not.

@@ -258,20 +258,19 @@ export function saveFolder(folder: ITopicFolder, data: {name: string}, global?:
const state = getState();
const url = getFoldersUrl(state.company, state.user?._id, global, folder._id);

const returnFolder = (allFolders: IFoldersUnified, id: string) =>
Copy link
Member

Choose a reason for hiding this comment

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

It's not a good practice to use the word return in the function name, because it causes confusion with the built-in return operator. Use get/find instead. I'd call it simply getFolder

@thecalcc thecalcc requested a review from tomaskikutis January 26, 2024 11:13
@thecalcc thecalcc merged commit 4c3e78e into superdesk:develop Jan 29, 2024
7 checks passed
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.

3 participants