Skip to content
Prev Previous commit
Next Next commit
Use Id instead of ID
  • Loading branch information
BrunoQuaresma committed May 26, 2022
commit 2822db08af58b3d51663ab49008aaefe89b964b0
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useActor } from "@xstate/react"
import { useContext } from "react"
import { XServiceContext } from "../xServices/StateContext"

export const useOrganizationID = (): string => {
export const useOrganizationId = (): string => {
const xServices = useContext(XServiceContext)
const [authState] = useActor(xServices.authXService)
const organizationId = authState.context.me?.organization_ids[0]
Expand Down
4 changes: 2 additions & 2 deletions site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { useMachine } from "@xstate/react"
import React from "react"
import { useNavigate, useSearchParams } from "react-router-dom"
import { Template } from "../../api/typesGenerated"
import { useOrganizationID } from "../../hooks/useOrganizationID"
import { useOrganizationId } from "../../hooks/useOrganizationId"
import { createWorkspaceMachine } from "../../xServices/createWorkspace/createWorkspaceXService"
import { CreateWorkspacePageView } from "./CreateWorkspacePageView"

const CreateWorkspacePage: React.FC = () => {
const organizationId = useOrganizationID()
const organizationId = useOrganizationId()
const [searchParams] = useSearchParams()
const preSelectedTemplateName = searchParams.get("template")
const navigate = useNavigate()
Expand Down
4 changes: 2 additions & 2 deletions site/src/pages/TemplatePage/TemplatePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMachine } from "@xstate/react"
import React from "react"
import { useParams } from "react-router-dom"
import { Loader } from "../../components/Loader/Loader"
import { useOrganizationID } from "../../hooks/useOrganizationID"
import { useOrganizationId } from "../../hooks/useOrganizationId"
import { templateMachine } from "../../xServices/template/templateXService"
import { TemplatePageView } from "./TemplatePageView"

Expand All @@ -17,7 +17,7 @@ const useTemplateName = () => {
}

export const TemplatePage: React.FC = () => {
const organizationId = useOrganizationID()
const organizationId = useOrganizationId()
const templateName = useTemplateName()
const [templateState] = useMachine(templateMachine, {
context: {
Expand Down