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:
rjmacarthy
2023-01-13 17:05:10 +00:00
parent fd8bd49638
commit 2a8d38f058
18 changed files with 56 additions and 56 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import { EvaluateTask } from "src/components/Tasks/EvaluateTask";
import { LabelTask } from "src/components/Tasks/LabelTask";
import { TaskCategory, TaskInfo, TaskTypes } from "src/components/Tasks/TaskTypes";
import { UnchangedWarning } from "src/components/Tasks/UnchangedWarning";
import poster from "src/lib/poster";
import { post } from "src/lib/api";
import { TaskContent } from "src/types/Task";
import { TaskReplyState } from "src/types/TaskReplyState";
import useSWRMutation from "swr/mutation";
@@ -28,7 +28,7 @@ export const Task = ({ frontendId, task, trigger, mutate }) => {
const taskType = TaskTypes.find((taskType) => taskType.type === task.type);
const { trigger: sendRejection } = useSWRMutation("/api/reject_task", poster, {
const { trigger: sendRejection } = useSWRMutation("/api/reject_task", post, {
onSuccess: async () => {
mutate();
},