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

feat(organizations): mutation hook for updating name and website TASK-1219 #5318

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

magicznyleszek
Copy link
Member

🗒️ Checklist

  1. run linter locally
  2. update all related docs (API, README, inline, etc.), if any
  3. draft PR with a title <type>(<scope>)<!>: <title> TASK-1234
  4. tag PR: at least frontend or backend unless it's global
  5. fill in the template below and delete template comments
  6. review thyself: read the diff and repro the preview as written
  7. open PR & confirm that CI passes
  8. request reviewers, if needed
  9. delete this section before merging

📣 Summary

📖 Description

👷 Description for instance maintainers

👀 Preview steps

Bug template:

  1. ℹ️ have an account and a project
  2. do this
  3. do that
  4. 🔴 [on main] notice that this isn't anywhere BUT it should be here
  5. 🟢 [on PR] notice that this is here

Feature/no-change template:

  1. ℹ️ have account and a project
  2. do this
  3. do that
  4. 🟢 notice that this is there
  5. do that another thing
  6. 🟢 notice that this changed like that

💭 Notes

cleanup Organization types, add usePatchOrganization mutation hook and reorganize imports

* Mutation hook for updating organization. It ensures that all related queries
* refetch data (are invalidated).
*/
export function usePatchOrganization(orgUrl: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

orgUrl seems like something that's a singleton and always available in the global state/cache, so let's simplify and grab it within the hook to avoid grabbing it in parent and passing around as parameter.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Akuukis I tried adding this previously:

const session = useSession();
const orgUrl = session.currentLoggedAccount?.organization?.url;

But orgUrl is not always string (TypeScript says so), so what's the best approach here?

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

Successfully merging this pull request may close these issues.

2 participants