DocSpace-buildtools/packages/asc-web-common/api/rooms/index.js

48 lines
919 B
JavaScript
Raw Normal View History

import { request } from "../client";
export function getRooms(filter) {
const options = {
method: "get",
url: `/files/rooms?${filter.toApiUrlParams()}`,
};
return request(options).then((res) => {
return res;
});
}
2022-06-28 10:24:31 +00:00
export function createRoom(data) {
const options = { method: "post", url: `/files/rooms`, data };
return request(options).then((res) => {
return res;
});
}
export function pinRoom(id) {
const options = { method: "put", url: `/files/rooms/${id}/pin` };
return request(options).then((res) => {
return res;
});
}
export function unpinRoom(id) {
const options = { method: "put", url: `/files/rooms/${id}/unpin` };
return request(options).then((res) => {
return res;
});
}
export function deleteRoom(id) {
const options = {
method: "delete",
url: `/files/rooms/${id}`,
};
return request(options).then((res) => {
return res;
});
}