mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-01 12:10:19 +08:00
Refactor fetch and post to use axios
Fix set_label id missing in payload use frontend_message_id pre-commit Refactor api fetcher/poster to axios create lint Remove string literal for path Revert oasst_api_client.ts Fix warning httpStatusCode OasstError optional parameter Refactor remove api base url for local api Lint add blank line
This commit is contained in:
@@ -6,7 +6,7 @@ import { useSession } from "next-auth/react";
|
||||
import { useEffect } from "react";
|
||||
import { getAdminLayout } from "src/components/Layout";
|
||||
import { UserMessagesCell } from "src/components/UserMessagesCell";
|
||||
import poster from "src/lib/poster";
|
||||
import { post } from "src/lib/api";
|
||||
import prisma from "src/lib/prismadb";
|
||||
import useSWRMutation from "swr/mutation";
|
||||
|
||||
@@ -31,7 +31,7 @@ const ManageUser = ({ user }) => {
|
||||
}, [router, session, status]);
|
||||
|
||||
// Trigger to let us update the user's role. Triggers a toast when complete.
|
||||
const { trigger } = useSWRMutation("/api/admin/update_user", poster, {
|
||||
const { trigger } = useSWRMutation("/api/admin/update_user", post, {
|
||||
onSuccess: () => {
|
||||
toast({
|
||||
title: "User Role Updated",
|
||||
|
||||
Reference in New Issue
Block a user