import { getRequest, postRequest } from "."
import apiEndpoints from "./apiEndpoints";

export const attemptFetchChats = (payload) => {
    return getRequest(`users/${payload}/chat`);
}
export const attemptFetchHeaderChats = (payload) => {
    return getRequest(`users/${payload}/chat/?page=1&size=2`)
}
export const attemptFetchOneChat = (payload) => {
    return getRequest(apiEndpoints.chat.getChat + `/${payload}`);
}
export const attemptSendMessage = (chatId, message) => {
    return postRequest(apiEndpoints.chat.sendMessage + `/${chatId}`, message)
}
export const attemptCreateNewChat = (payload) => {
    return postRequest(`offers/${payload}/chat`)
}