mirror of
https://github.com/jlengrand/simple-food-diary.git
synced 2026-03-10 08:41:19 +00:00
WTFFFFFF
This commit is contained in:
@@ -4,11 +4,18 @@ const mongoose = require('mongoose');
|
||||
|
||||
console.log('running!');
|
||||
|
||||
mongoose.connect(process.env.CONNECTION_STRING);
|
||||
mongoose.connect(
|
||||
process.env.CONNECTION_STRING, // Retrieve connection string
|
||||
{
|
||||
// boiler plate values
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
}
|
||||
);
|
||||
|
||||
const entrySchema = new mongoose.Schema({
|
||||
portionSize: String,
|
||||
mealTypes: [String],
|
||||
// mealTypes: [String],
|
||||
});
|
||||
const EntryModel = mongoose.model('entry', entrySchema);
|
||||
|
||||
|
||||
@@ -38,14 +38,13 @@ class FoodLogForm extends LitElement {
|
||||
const portionSize = this.shadowRoot!.querySelector<HTMLInputElement>(
|
||||
'input[type=radio]:checked'
|
||||
)?.value;
|
||||
const mealTypes = Array.from<HTMLInputElement>(
|
||||
this.shadowRoot!.querySelectorAll('input[type=checkbox]:checked')
|
||||
).map(e => e.value);
|
||||
// const mealTypes = Array.from<HTMLInputElement>(
|
||||
// this.shadowRoot!.querySelectorAll('input[type=checkbox]:checked')
|
||||
// ).map(e => e.value);
|
||||
|
||||
// TODO : add timestamp
|
||||
const meal = {
|
||||
portionSize,
|
||||
mealTypes,
|
||||
};
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
|
||||
Reference in New Issue
Block a user