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

Search for stored value in local data #9

Merged
merged 1 commit into from
Feb 10, 2024
Merged

Conversation

paulrobertlloyd
Copy link
Contributor

While data for a form may likely exist in session data, it may be the case that data for the item being edited has been saved to local data:

// request.session
data: {
  users: {
    1: {
      name: 'Paul'
    }
  }
},
// response.locals
user: {
  name: 'Paul'
}

Currently, it’s not possible to access local data via the decorate function, without saving it to session data first (which would then involve removing it again once it is no longer needed).

This change mains a preference for searching for values in session data, but if no value can be found, does a further search in local data before returning nothing.

@paulrobertlloyd paulrobertlloyd merged commit f9cbf61 into main Feb 10, 2024
1 check passed
@paulrobertlloyd paulrobertlloyd deleted the search-locals branch February 10, 2024 23:56
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.

1 participant