27 lines
607 B
JavaScript
27 lines
607 B
JavaScript
import axios from "axios";
|
|
|
|
|
|
|
|
|
|
export const getRoom = async (_id) => {
|
|
try {
|
|
const response = await axios.get("/room", {_id});
|
|
console.log(response.data)
|
|
return response.data;
|
|
} catch (error) {
|
|
console.log("ERROR", error.response.data)
|
|
return error.response.data;
|
|
}
|
|
};
|
|
|
|
export const getRooms = async () => {
|
|
try {
|
|
const response = await axios.get("/room", {});
|
|
console.log(response.data)
|
|
return response.data;
|
|
} catch (error) {
|
|
console.log("ERROR", error.response.data)
|
|
return error.response.data;
|
|
}
|
|
};
|