2017-07-15 07:20:16 +08:00
|
|
|
import Cursor from '/imports/api/2.0/cursor';
|
2017-07-29 08:29:40 +08:00
|
|
|
import Users from '/imports/api/2.0/users';
|
2017-05-05 05:10:49 +08:00
|
|
|
|
2017-08-15 08:15:11 +08:00
|
|
|
const getCurrentCursor = (cursorId) => {
|
|
|
|
const cursor = Cursor.findOne({ _id: cursorId });
|
|
|
|
if (cursor) {
|
|
|
|
const { userId } = cursor;
|
|
|
|
const user = Users.findOne({ userId });
|
|
|
|
if (user) {
|
|
|
|
cursor.userName = user.user.name;
|
|
|
|
return cursor;
|
|
|
|
}
|
2017-07-29 08:29:40 +08:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
};
|
2017-05-05 05:10:49 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
getCurrentCursor,
|
|
|
|
};
|