import axios from "axios";
import { apiUrl } from "../config/urls";

axios.defaults.baseURL = apiUrl;

const responseBody = (response) => response.data;

const methods = {
  getRooms: (customerId) => axios.get(`/Room/rooms-with-filtered-messages?customerId=${customerId}`).then(responseBody),
  createRoom: (payload) => axios.post("/Room", payload).then(responseBody),
  getSupportRooms:(supportId) => axios.get(`/Room/support-rooms?supportId=${supportId}`).then(responseBody)
};

export default methods;
