Skip to content

Commit

Permalink
Fix codestyle for workspace (#7304)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamakase authored Oct 25, 2021
1 parent 98d87b1 commit 6ead334
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ class CloudWorkspacesService extends AirbyteRequestService {
return workspaces;
}

public async get(workspaceId?: string | null): Promise<CloudWorkspace> {
if (!workspaceId) {
return Promise.resolve({
name: "",
workspaceId: "",
billingUserId: "",
remainingCredits: 0,
});
}

public async get(workspaceId: string): Promise<CloudWorkspace> {
return await this.fetch<CloudWorkspace>(`${this.url}/get`, {
workspaceId,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function useRemoveWorkspace() {
);
}

export function useGetWorkspace(workspaceId?: string | null) {
export function useGetWorkspace(workspaceId: string) {
const service = useGetWorkspaceService();

return useQuery<CloudWorkspace>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
useGetWorkspace,
useWorkspaceService,
} from "packages/cloud/services/workspaces/WorkspacesService";
import { useCurrentWorkspace } from "hooks/services/useWorkspace";

const Header = styled.div`
display: flex;
Expand All @@ -38,9 +39,11 @@ export const WorkspaceSettingsView: React.FC = () => {
selectWorkspace,
removeWorkspace,
updateWorkspace,
currentWorkspaceId,
} = useWorkspaceService();
const { data: workspace, isLoading } = useGetWorkspace(currentWorkspaceId);
const currentWorkspace = useCurrentWorkspace();
const { data: workspace, isLoading } = useGetWorkspace(
currentWorkspace.workspaceId
);

return (
<>
Expand Down

0 comments on commit 6ead334

Please sign in to comment.