import Item from '../../models/item';
import getItems from './getItems';

export default function addItem(req) {
  return Item.create({
    text: req.body['text'],
    completed: false
  }).then(() => { return Item.find().exec() });
}

import Item from '../../models/item';
import getItems from './getItems';

export default function addItem(req) {
  return Item.create({
    text: req.body['text'],
    completed: false
  }).then(() => { return getItems() });
}

Use getItems to return new list of items after adding
Use getItems to return new list of items after adding
