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
@@ -1,6 +1,6 @@
import { Box, CircularProgress, useColorModeValue } from "@chakra-ui/react";
import { MessageTable } from "src/components/Messages/MessageTable";
import fetcher from "src/lib/fetcher";
import { get } from "src/lib/api";
import useSWR from "swr";
interface UserMessagesCellProps {
@@ -16,7 +16,7 @@ interface UserMessagesCellProps {
*/
const UserMessagesCell = ({ path }: UserMessagesCellProps) => {
const url = path || "/api/messages/user";
const { data: messages, isLoading } = useSWR(url, fetcher, {
const { data: messages, isLoading } = useSWR(url, get, {
refreshInterval: 2000,
});
// TODO(#651): This box coloring and styling is used in multiple places. We