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

Error when trying to navigate to profile setting page #49

Open
hazamashoken opened this issue Jan 17, 2024 · 2 comments
Open

Error when trying to navigate to profile setting page #49

hazamashoken opened this issue Jan 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@hazamashoken
Copy link
Member

Expected Behavior

I should be at the profile setting page and see the profile setting

Current Behavior

image

Detective work

  • getProfileSettings() is call when rendering the profile setting page
  • however new user don't have their profileSettings entity so it return null
  • return { data: profileSettingFormSchema.parse(res), error: null }; and this throw error

Possible Solution

  • if null then create a new profileSettings for them
  • else return the entity

Steps to Reproduce

  1. Login with intra account
  2. click the profile setting link under the profile tab in the navbar
  3. error
@hazamashoken hazamashoken added the bug Something isn't working label Jan 17, 2024
@Lodimup
Copy link
Contributor

Lodimup commented Jan 17, 2024

Hmm get or create behavior should work.

Or if res is null; res = {}

Or we can also create profile when first logged in?

Ensuring there's a profile for every user will cause less problem.

@hazamashoken
Copy link
Member Author

hazamashoken commented Jan 18, 2024

that would be great but I think we shouldn't parse anything that came out from the db. This look like very much foot gunning and not trusting yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants