notherbase-fs 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/controllers/the-front.js +9 -0
- package/package.json +1 -1
package/controllers/the-front.js
CHANGED
|
@@ -9,6 +9,7 @@ let front = function front(detail) {
|
|
|
9
9
|
styles: [],
|
|
10
10
|
externalStyles: [],
|
|
11
11
|
localScripts: [],
|
|
12
|
+
requiredItems: [],
|
|
12
13
|
needsKey: "",
|
|
13
14
|
dropOff: "",
|
|
14
15
|
...detail.options
|
|
@@ -34,6 +35,13 @@ let front = function front(detail) {
|
|
|
34
35
|
detail.options.main = `${dir}/views/${detail.options.main}`;
|
|
35
36
|
|
|
36
37
|
router.get(`/${detail.name}`, async function(req, res) {
|
|
38
|
+
let foundItemIDs = [];
|
|
39
|
+
for (let m = 0; m < detail.options.requiredItems.length; m++) {
|
|
40
|
+
let foundItem = await item.findOne({name: detail.options.requiredItems[m]});
|
|
41
|
+
|
|
42
|
+
foundItemIDs.push(foundItem._id);
|
|
43
|
+
}
|
|
44
|
+
|
|
37
45
|
let context = {
|
|
38
46
|
siteTitle: "NotherBase | The Front",
|
|
39
47
|
user: null,
|
|
@@ -41,6 +49,7 @@ let front = function front(detail) {
|
|
|
41
49
|
externalStyles: detail.options.externalStyles,
|
|
42
50
|
main: detail.options.main,
|
|
43
51
|
localScripts: detail.options.localScripts,
|
|
52
|
+
itemIDs: foundItemIDs,
|
|
44
53
|
inventory: null,
|
|
45
54
|
query: req.query
|
|
46
55
|
}
|