notherbase-fs 3.0.9 → 3.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {
@@ -1,15 +1,9 @@
1
1
  export default async function emailTime(req, user) {
2
- try {
3
- await req.db.SendMail.send(
4
- req.body.data.toEmail,
5
- req.body.data.subject,
6
- req.body.data.html
7
- );
2
+ await req.db.SendMail.send(
3
+ req.body.data.toEmail,
4
+ req.body.data.subject,
5
+ req.body.data.html
6
+ );
8
7
 
9
- return "Sent";
10
- }
11
- catch(err) {
12
- console.log(err);
13
- return false;
14
- }
8
+ return "Sent";
15
9
  }
@@ -19,21 +19,29 @@
19
19
  <link rel="stylesheet" href="/styles/account.css">
20
20
  <link rel="stylesheet" href="/styles/more.css">
21
21
  <link rel="stylesheet" href="/styles/chat.css">
22
+ <script src="/js/base.js"></script>
22
23
  </head>
24
+
25
+ <script>
26
+ const currentRoute = "<%- route %>";
27
+
28
+ <%- include("../../../views/scripts/base.js", {user: user}); %>
29
+ </script>
30
+
31
+
23
32
  <body>
24
33
  Test hahahahahah
25
34
  <button onclick="emailTime()">email</button>
26
35
  </body>
27
36
 
28
- <script src="/js/commune.js"></script>
29
37
  <script>
30
38
  let emailTime = async () => {
31
- await commune("servePages", {
32
- script: "emailTime",
39
+ base.do("emailTime", {
33
40
  toEmail: "wyattsushi@gmail.com",
34
41
  subject: "New Time Update!",
35
- html: `New Time: 358970976`
36
- }, { route: "/test" });
42
+ html: `New Time: 358970976`,
43
+ route: "/pages/test-page"
44
+ });
37
45
  }
38
46
  </script>
39
47
  </html>
@@ -292,8 +292,8 @@ class Base {
292
292
  console.log(window.location.pathname);
293
293
  let response = await Base.commune("/s/serve", {
294
294
  script: what,
295
- ...data,
296
- route: window.location.pathname
295
+ route: window.location.pathname,
296
+ ...data
297
297
  });
298
298
 
299
299
  this.playerInventory.refresh();