-
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
- Loading branch information
1 parent
5a55a7a
commit 62860ec
Showing
20 changed files
with
1,608 additions
and
413 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
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.