import { http } from "@/shared/api/httpClient";
import {
  CreateAuthorizeResponseSchema,
  ICreateAuthorizeRequest,
  ICreateAuthorizeResponse,
} from "./types";
import { API_ROUTES } from "@/shared/constants/api-routes";

export const createAuthorization = async (
  payload: ICreateAuthorizeRequest
): Promise<ICreateAuthorizeResponse> => {
  return http.post<ICreateAuthorizeResponse>(
    API_ROUTES.authorization(),
    payload,
    {
      tags: ["authorization", "create"],
      schema: CreateAuthorizeResponseSchema,
      revalidate: 0,
    }
  );
};
