refactor(client): use generated API client and hooks
All checks were successful
Client CMS Check Build (NixCN CMS) TeamCity build finished
Backend Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
2026-01-29 11:43:46 +08:00
parent f898243de5
commit a0f6087d3e
38 changed files with 4076 additions and 217 deletions

View File

@@ -0,0 +1,16 @@
import { postAuthExchangeMutation } from "@/client/@tanstack/react-query.gen";
import { useMutation } from "@tanstack/react-query";
import { toast } from "sonner";
export function useExchangeToken() {
return useMutation({
...postAuthExchangeMutation(),
onSuccess: (data) => {
window.location.href = data.data?.redirect_uri!;
},
onError: (error) => {
console.error(error);
toast("An error occurred while exchanging the token. Please login manually.");
}
})
}