mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Add useBuildProject, useDeployProject hooks
This commit is contained in:
3 files changed
+86
-66
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { buildProject } from "@/lib/build";
|
||||
import { useFS } from "./useFS";
|
||||
|
||||
export function useBuildProject(projectId: string) {
|
||||
const { fs } = useFS();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async () => {
|
||||
return await buildProject({
|
||||
fs,
|
||||
projectPath: `/projects/${projectId}`,
|
||||
domParser: new DOMParser(),
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user