Archived
1
0
Fork 0

Some order on list

This commit is contained in:
Ethanell 2020-05-30 17:02:17 +02:00
parent c4babbe5aa
commit 7b3fca46d2
5 changed files with 15 additions and 5 deletions

View file

@ -3,7 +3,9 @@ const models = require("../models");
module.exports = socket => { module.exports = socket => {
return async () => { return async () => {
let desserts = [] let desserts = []
for (let i of await models.Dessert.findAll()) { for (let i of await models.Dessert.findAll({
order: ["name"]
})) {
desserts.push({ desserts.push({
id: i.id, id: i.id,
name: i.name, name: i.name,

View file

@ -3,7 +3,9 @@ const models = require("../models");
module.exports = socket => { module.exports = socket => {
return async () => { return async () => {
let dishes = [] let dishes = []
for (let d of await models.Dish.findAll()) { for (let d of await models.Dish.findAll({
order: ["name"]
})) {
dishes.push({ dishes.push({
id: d.id, id: d.id,
name: d.name, name: d.name,

View file

@ -3,7 +3,9 @@ const models = require("../models");
module.exports = socket => { module.exports = socket => {
return async () => { return async () => {
let drinks = [] let drinks = []
for (let i of await models.Drink.findAll()) { for (let i of await models.Drink.findAll({
order: ["name"]
})) {
drinks.push({ drinks.push({
id: i.id, id: i.id,
name: i.name, name: i.name,

View file

@ -3,7 +3,9 @@ const models = require("../models");
module.exports = socket => { module.exports = socket => {
return async () => { return async () => {
let ingredients = [] let ingredients = []
for (let i of await models.Ingredient.findAll()) { for (let i of await models.Ingredient.findAll({
order: ["name"]
})) {
ingredients.push({ ingredients.push({
id: i.id, id: i.id,
name: i.name, name: i.name,

View file

@ -3,7 +3,9 @@ const models = require("../models");
module.exports = socket => { module.exports = socket => {
return async () => { return async () => {
let sauces = [] let sauces = []
for (let d of await models.Sauce.findAll()) { for (let d of await models.Sauce.findAll({
order: ["name"]
})) {
sauces.push({ sauces.push({
id: d.id, id: d.id,
name: d.name, name: d.name,