-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate gRPC workspaceService other workspace related method (#19118)
* Migrate gRPC workspaceService other workspace related method * Use shim and gRPC everywhere * fix update
- Loading branch information
1 parent
2b5a36e
commit 0152b84
Showing
25 changed files
with
1,626 additions
and
428 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
components/dashboard/src/data/workspaces/toggle-workspace-pinned-mutation.ts
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
components/dashboard/src/data/workspaces/toggle-workspace-shared-mutation.ts
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
components/dashboard/src/data/workspaces/update-workspace-description-mutation.ts
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
components/dashboard/src/data/workspaces/update-workspace-mutation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Copyright (c) 2023 Gitpod GmbH. All rights reserved. | ||
* Licensed under the GNU Affero General Public License (AGPL). | ||
* See License.AGPL.txt in the project root for license information. | ||
*/ | ||
|
||
import { useMutation } from "@tanstack/react-query"; | ||
import { useUpdateWorkspaceInCache } from "./list-workspaces-query"; | ||
import { UpdateWorkspaceRequest } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; | ||
import { PartialMessage } from "@bufbuild/protobuf"; | ||
import { workspaceClient } from "../../service/public-api"; | ||
|
||
export const useUpdateWorkspaceMutation = () => { | ||
const updateWorkspace = useUpdateWorkspaceInCache(); | ||
|
||
return useMutation({ | ||
mutationFn: async (data: PartialMessage<UpdateWorkspaceRequest>) => { | ||
return await workspaceClient.updateWorkspace(data); | ||
}, | ||
onSuccess: (data) => { | ||
if (data.workspace) { | ||
updateWorkspace(data.workspace); | ||
} | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.