mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Merge branch 'dev' into 'main'
Adding new files. See merge request bmcgonag/get_my!15
This commit is contained in:
commit
b245fde84c
4 changed files with 78 additions and 2 deletions
10
client/ListItems/listItemTblByStore.html
Normal file
10
client/ListItems/listItemTblByStore.html
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<template name="listItemTblByStore">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col s12">
|
||||||
|
<ul class="collection with-header">
|
||||||
|
<li class="collection-header"><h4>First Names</h4></li>
|
||||||
|
<li class="collection-item">Alvin</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
30
client/ListItems/listItemTblByStore.js
Normal file
30
client/ListItems/listItemTblByStore.js
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
import { ListItems } from '../../imports/api/listItems.js';
|
||||||
|
import { M } from '../lib/assets/materialize.js';
|
||||||
|
import { UserLast } from '../../imports/api/userLast.js';
|
||||||
|
import { Stores } from '../../imports/api/stores.js';
|
||||||
|
|
||||||
|
Template.listItemTblByStore.onCreated(function() {
|
||||||
|
this.autorun( () => {
|
||||||
|
this.subscribe("myListItems", Session.get("listId"));
|
||||||
|
});
|
||||||
|
this.subscribe("storeInfo");
|
||||||
|
this.subscribe("userLastView");
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.listItemTblByStore.onRendered(function() {
|
||||||
|
Session.set("showReceivedItems", false);
|
||||||
|
Session.set("searchVal", "");
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.listItemTblByStore.helpers({
|
||||||
|
thisListItems: function() {
|
||||||
|
let showReceved = Session.get("showReceivedItems");
|
||||||
|
let searchVal = Session.get("searchVal");
|
||||||
|
let stores = Stores.find({}).fetch();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.listItemTblByStore.events({
|
||||||
|
|
||||||
|
});
|
||||||
|
|
@ -32,8 +32,6 @@ Meteor.methods({
|
||||||
prodOwner: this.userId,
|
prodOwner: this.userId,
|
||||||
prodStore: prodStore,
|
prodStore: prodStore,
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
console.log(" ---- Product exsits in database already.");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'edit.product' (prodId, prodName, prodStore) {
|
'edit.product' (prodId, prodName, prodStore) {
|
||||||
|
|
|
||||||
38
imports/api/updateInfo.js
Normal file
38
imports/api/updateInfo.js
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
import { Meteor } from 'meteor/meteor';
|
||||||
|
import { Mongo } from 'meteor/mongo';
|
||||||
|
import { check } from 'meteor/check';
|
||||||
|
|
||||||
|
export const UpdateInfo = new Mongo.Collection('updateInfo');
|
||||||
|
|
||||||
|
UpdateInfo.allow({
|
||||||
|
insert: function(userId, doc){
|
||||||
|
// if use id exists, allow insert
|
||||||
|
return !!userId;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
Meteor.methods({
|
||||||
|
'add.updateInfo' (updateObject) {
|
||||||
|
check(updateObject, Object);
|
||||||
|
|
||||||
|
UpdateInfo.insert({
|
||||||
|
title: updateObject.title,
|
||||||
|
description: updateObject.description,
|
||||||
|
dateRelease: updateObject.date,
|
||||||
|
releaseLink: updateObject.link
|
||||||
|
});
|
||||||
|
},
|
||||||
|
'markUpdate.read' (updateId) {
|
||||||
|
check(updateId, String);
|
||||||
|
|
||||||
|
if (!this.userId) {
|
||||||
|
throw new Meteor.Error('You are not allowed to mark updates as read. Make sure you are logged in with valid user credentials.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return UpdateInfo.update({ _id: updateId }, {
|
||||||
|
$set: {
|
||||||
|
viewed: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue