File size: 542 Bytes
5893f8f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { createContainer } from 'meteor/react-meteor-data';

import Notice from '/imports/api/notices/collection';
import _Component from '../components/notice';

function _data(props) {
  const id = props.location.query.id;
  const type = props.location.query.type;
  if (id) {
    const ready = Meteor.subscribe('notices.one', id).ready();
    const data = Notice.findOne(id);
    return {
      edit: true,
      ready,
      data
    };
  }
  return {
    edit: false,
    type,
  };
}

export default createContainer(_data, _Component);