-
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.
- Loading branch information
1 parent
b897f2c
commit a8c3b73
Showing
9 changed files
with
73 additions
and
179 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
44 changes: 0 additions & 44 deletions
44
components/dashboard/src/data/workspaces/toggle-workspace-pinned-mutation.ts
This file was deleted.
Oops, something went wrong.
57 changes: 0 additions & 57 deletions
57
components/dashboard/src/data/workspaces/toggle-workspace-shared-mutation.ts
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
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
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