halo/ui/uc-src/modules/contents/posts/composables/use-post-publish-mutate.ts

20 lines
444 B
TypeScript

import { ucApiClient } from "@halo-dev/api-client";
import { useMutation } from "@tanstack/vue-query";
export function usePostPublishMutate() {
return useMutation({
mutationKey: ["uc:publish-post"],
mutationFn: async ({ name }: { name: string }) => {
return await ucApiClient.content.post.publishMyPost(
{
name: name,
},
{
mute: true,
}
);
},
retry: 3,
});
}