feat: [MP-2469] - use setMyKivaGoal mutation on GoalData composable#6676
feat: [MP-2469] - use setMyKivaGoal mutation on GoalData composable#6676cristhianDt wants to merge 17 commits intomainfrom
setMyKivaGoal mutation on GoalData composable#6676Conversation
…es` on useGoalData composable
dyersituations
left a comment
There was a problem hiding this comment.
Marking this as blocked while we investigate other data sync options.
|
@cristhianDt I see this is still marked as draft and has some unresolved comment threads. Please take a look at those threads and reopen + re-request a review from the team when it's stable. |
yeah, I'm on it, thanks for moving back to draft 👍 |
|
@dyersituations I think this PR is ready for review, I tagged christian to continue talking about his comments, there is just one question for you > #6676 (comment) |
dyersituations
left a comment
There was a problem hiding this comment.
See comments, especially around still including support for delete case, where we can just remove from the user preferences.
dyersituations
left a comment
There was a problem hiding this comment.
See comment about upsert.
dyersituations
left a comment
There was a problem hiding this comment.
Some minor improvements remaining.
| await updateCurrentGoal(userGoal.value, preferences); | ||
| await recalculateGoalInformation(); | ||
| try { | ||
| await updateCurrentGoal(userGoal.value, preferences); |
There was a problem hiding this comment.
This method uses updateUserPreferences which already has a try catch, so this try catch likely won't be hit. Should we remove?
| await this.storeGoalPreferences(preferences, updateLocalState); | ||
| } | ||
| } catch (error) { | ||
| const msg = this.isUpdatingGoal ? 'updating' : 'setting up'; |
There was a problem hiding this comment.
This message will now likely not be triggered for the update path, consider moving the try catch into the else above, since that's where the upsert is being called.
Co-authored-by: Cristhian Torres <30540297+cristhianDt@users.noreply.github.com>
| * @param {string} goalData.status The goal status | ||
| * @returns The result of the mutation | ||
| */ | ||
| export const setMyKivaGoal = async (apollo, { |
There was a problem hiding this comment.
|
@dyersituations recent changes added a lot of conflicts in this branch so I decided closing this one and open a new one |


MP-2469
updateUserPreferencesmutation on GoalData composablesetMyKivaGoalmutationhttps://kiva.atlassian.net/browse/MP-2469