import routes from "@/routes";
import { getAuthHeaders } from "../utils";
import { AuthPayload } from "../types";

export type Payload = {
    assistantId: string
} & AuthPayload

interface IResponseGetSuccess {
    chatId: string
}

// interface IResponseGetError {
//     status: string;
//     message: string;
// }

export type ResponseGet = IResponseGetSuccess

export const createRequest = ({ assistantId, token }: Payload): Request => {
    const url = new URL(routes.server.createChat(assistantId));
    return new Request(url, { method: "POST", headers: getAuthHeaders(token) });
};
