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

interface Payload {
    token: string;
}

export type PayloadGet = Payload;

export interface IUserVideo {
    id: string,
    videoUrl: string,
    createdAt: string
}

type ResponseGetSuccess = IUserVideo[];

export type ResponseGet = ResponseGetSuccess;

export const createRequest = ({ token }: PayloadGet): Request => {
    const url = new URL(routes.server.getUserVideos());
    return new Request(url, { method: "GET", headers: getAuthHeaders(token) });
};
