Added Measurements input

This commit is contained in:
Brian McGonagill 2026-02-10 16:38:44 -06:00
parent ba17d57987
commit 98a86ca6a8
12 changed files with 337 additions and 10 deletions

View file

@ -6,6 +6,8 @@ import { Roels } from "meteor/roles";
import { Workouts } from "../imports/api/workouts";
import { WorkoutLog } from "../imports/api/workoutLog";
import { LogEntry } from "../imports/api/logEntry";
import { Measurements } from "../imports/api/measurements";
import { MeasureLogEntry } from "../imports/api/measureLogEntry";
Meteor.publish("SystemConfig", function() {
try {
@ -67,3 +69,33 @@ Meteor.publish("myLogEntries", function (routineId) {
console.log(" ERROR in pulling workout routines: " + error);
}
});
Meteor.publish("allMyLogEntries", function() {
try {
if (this.userId) {
return LogEntry.find({ addedBy: this.userId });
}
} catch(error) {
console.log(" ERROR returning all of my log entries: " + error);
}
});
Meteor.publish("myMeasures", function() {
try {
if (this.userId) {
return Measurements.find({ addedBy: this.userId, measurementActive: true });
}
} catch(error) {
console.log(" ERROR returning all of my measurements: " + error);
}
});
Meteor.publish("myMeasureLog", function() {
try {
if (this.userId) {
return MeasureLogEntry.find({ addedBy: this.userId });
}
} catch(error) {
console.log(" ERROR returning all of my measurement log entries: " + error);
}
});