The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/tests/data/groups.helper.ts

22 lines
654 B

import { api, credentials, request } from './api-data';
export const createGroup = ({ name }: { name: string }) => {
if (!name) {
throw new Error('"name" is required in "createGroup" test helper');
}
return request.post(api('groups.create')).set(credentials).send({ name });
};
export const deleteGroup = ({ groupId, roomName }: { groupId?: string; roomName?: string }) => {
if (!groupId && !roomName) {
throw new Error('"groupId" or "roomName" is required in "deleteGroup" test helper');
}
return request
.post(api('groups.delete'))
.set(credentials)
.send({
...(groupId && { groupId }),
...(roomName && { roomName }),
});
};