Skip to content

Commit

Permalink
call loadCurrentOrganization in createTeamSuccess listener
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajmajerik committed Oct 27, 2023
1 parent f39991e commit e937307
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions frontend/src/scenes/project/CreateProjectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export function CreateProjectModal({
inline?: boolean
}): JSX.Element {
const { createTeam } = useActions(teamLogic)
const { loadCurrentOrganization } = useActions(organizationLogic)
const { currentOrganization } = useValues(organizationLogic)
const { reportProjectCreationSubmitted } = useActions(eventUsageLogic)
const [name, setName] = useState<string>('')
Expand All @@ -32,7 +31,6 @@ export function CreateProjectModal({
const handleSubmit = (): void => {
createTeam({ name, is_demo: false })
reportProjectCreationSubmitted(currentOrganization?.teams ? currentOrganization.teams.length : 0, name.length)
loadCurrentOrganization()
closeModal()
}

Expand Down
3 changes: 3 additions & 0 deletions frontend/src/scenes/teamLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ export const teamLogic = kea<teamLogicType>([
],
})),
listeners(({ actions }) => ({
createTeamSuccess: () => {
organizationLogic.actions.loadCurrentOrganization()
},
deleteTeam: async ({ team }) => {
try {
await api.delete(`api/projects/${team.id}`)
Expand Down

0 comments on commit e937307

Please sign in to comment.