export const postMessage = text => {
  return {
    type: 'POST_MESSAGE',
    message
    text
  }
}

export const setVisibilityFilter (message) => {
  return {
    type: 'SET_VISIBILITY_FILTER',
    filter
  }
}

export const toggleTodo = id => {
  return {
    type: 'TOGGLE_TODO',
    id
  }
}
export const postMessage = (senderId, message, priority, isComment) => {
  return {
    type: 'POST_MESSAGE',
    message,
    priority,
    isComment,
    senderId,
  };
};

export const addUser = (email, groupId, adderId) => {
  return {
    type: 'ADD_MEMBER',
    email,
    groupId,
    adderId,
  };
};

export const deleteGroup = (ownerId, groupId) => {
  return {
    type: 'DELETE_GROUP',
    ownerId,
    groupId
  };
};

export const createGroup = (userId, title, description, initialMembers) => {
  return {
    type: 'CREATE_GROUP',
    userId,
    title,
    description,
    initialMembers
  };
};

export const getMessages = (groupId) => {
  return {
    type: 'GET_MESSAGES',
    groupId
  };
};

export const getGroupMembers = (groupId) => {
  return {
    type: 'GET_GROUP_MEMBERS',
    groupId
  };
};

export const getPostItMembers = () => {
  return {
    type: 'GET_POSTIT_MEMBERS',
  };
};

export const getAllGroups = () => {
  return {
    type: 'GET_ALL_GROUPS'
  };
};

export const deleteMember = (ownerId, email, groupId) => {
  return {
    type: 'DELETE_MEMBER',
    ownerId,
    email,
    groupId
  };
};

create redux actions