import { authInstance } from "@shared";
import { User } from "./index";

export const addUserCityApi = async (
  { id, city_ids }: { id: number; city_ids: number[] },
  signal?: AbortSignal,
): Promise<User> => {
  const response = await authInstance.patch(
    `/user/${id}/city`,
    { city_ids },
    { signal },
  );
  return response.data as User;
};
