public
/
ndcode_site.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
03b48fb
)
Change arguments to args everywhere, as arguments is a reserved word in strict
author
Nick Downing
<nick@ndcode.org>
Sat, 22 Jan 2022 06:26:38 +0000
(17:26 +1100)
committer
Nick Downing
<nick@ndcode.org>
Sat, 22 Jan 2022 06:26:38 +0000
(17:26 +1100)
_lib/navbar.jst
patch
|
blob
|
history
_lib/post_request.jst
patch
|
blob
|
history
contact/index.html.jst
patch
|
blob
|
history
js/api_call.js.min
patch
|
blob
|
history
my_account/index.html.jst
patch
|
blob
|
history
my_account/password_reset/index.html.jst
patch
|
blob
|
history
my_account/send_verification_email/index.html.jst
patch
|
blob
|
history
my_account/sign_up/index.html.jst
patch
|
blob
|
history
my_account/verify_email/index.html.jst
patch
|
blob
|
history
my_account/verify_password/index.html.jst
patch
|
blob
|
history
diff --git
a/_lib/navbar.jst
b/_lib/navbar.jst
index
32cce07
..
d3bad0c
100644
(file)
--- a/
_lib/navbar.jst
+++ b/
_lib/navbar.jst
@@
-293,17
+293,17
@@
return async (env, head, body, scripts) => {
script(src="/js/api_call.js") {}
script {
script(src="/js/api_call.js") {}
script {
- let api_account_sign_in = async (...arg
ument
s) => api_call(
+ let api_account_sign_in = async (...args) => api_call(
'/api/account/sign_in.json',
'/api/account/sign_in.json',
- ...arg
ument
s
+ ...args
)
)
- let api_account_sign_out = async (...arg
ument
s) => api_call(
+ let api_account_sign_out = async (...args) => api_call(
'/api/account/sign_out.json',
'/api/account/sign_out.json',
- ...arg
ument
s
+ ...args
)
)
- let api_feedback = async (...arg
ument
s) => api_call(
+ let api_feedback = async (...args) => api_call(
'/api/feedback.json',
'/api/feedback.json',
- ...arg
ument
s
+ ...args
)
// this function can be overridden in a further script
)
// this function can be overridden in a further script
diff --git
a/_lib/post_request.jst
b/_lib/post_request.jst
index
73fa773
..
79a930e
100644
(file)
--- a/
_lib/post_request.jst
+++ b/
_lib/post_request.jst
@@
-23,10
+23,10
@@
return async (env, handler) => {
}
)
env.request.pipe(write_stream)
}
)
env.request.pipe(write_stream)
- let arg
ument
s = JSON.parse((await data).toString())
- console.log('endpoint', env.parsed_url.path, 'arg
uments', JSON.stringify(argument
s))
+ let args = JSON.parse((await data).toString())
+ console.log('endpoint', env.parsed_url.path, 'arg
s', JSON.stringify(arg
s))
- result = await handler(...arg
ument
s)
+ result = await handler(...args)
if (result === undefined)
result = null
console.log('endpoint', env.parsed_url.path, 'result', JSON.stringify(result))
if (result === undefined)
result = null
console.log('endpoint', env.parsed_url.path, 'result', JSON.stringify(result))
diff --git
a/contact/index.html.jst
b/contact/index.html.jst
index
bb28ef7
..
fda3325
100644
(file)
--- a/
contact/index.html.jst
+++ b/
contact/index.html.jst
@@
-160,17
+160,17
@@
return async env => {
//script(src="/js/api_call.js") {}
script {
//script(src="/js/api_call.js") {}
script {
- //let api_contact_get_draft = async (...arg
ument
s) => api_call(
+ //let api_contact_get_draft = async (...args) => api_call(
// '/api/contact/get_draft.json',
// '/api/contact/get_draft.json',
- // ...arg
ument
s
+ // ...args
//)
//)
- let api_contact_set_draft = async (...arg
ument
s) => api_call(
+ let api_contact_set_draft = async (...args) => api_call(
'/api/contact/set_draft.json',
'/api/contact/set_draft.json',
- ...arg
ument
s
+ ...args
)
)
- let api_contact_send_enquiry = async (...arg
ument
s) => api_call(
+ let api_contact_send_enquiry = async (...args) => api_call(
'/api/contact/send_enquiry.json',
'/api/contact/send_enquiry.json',
- ...arg
ument
s
+ ...args
)
let draft_timeout_running = false
)
let draft_timeout_running = false
diff --git
a/js/api_call.js.min
b/js/api_call.js.min
index
aa1db76
..
12ebdae
100644
(file)
--- a/
js/api_call.js.min
+++ b/
js/api_call.js.min
@@
-6,10
+6,10
@@
Problem = class {
}
}
}
}
-api_call = async (endpoint, ...arg
ument
s) => {
+api_call = async (endpoint, ...args) => {
let response = await fetch(
endpoint,
let response = await fetch(
endpoint,
- {method: 'POST', body: JSON.stringify(arg
ument
s)}
+ {method: 'POST', body: JSON.stringify(args)}
)
let result = await response.json()
if (!response.ok)
)
let result = await response.json()
if (!response.ok)
diff --git
a/my_account/index.html.jst
b/my_account/index.html.jst
index
232f6fa
..
841790f
100644
(file)
--- a/
my_account/index.html.jst
+++ b/
my_account/index.html.jst
@@
-226,25
+226,25
@@
return async env => {
//script(src="/js/api_call.js") {}
script {
//script(src="/js/api_call.js") {}
script {
- let api_account_change_details_get = async (...arg
ument
s) => api_call(
+ let api_account_change_details_get = async (...args) => api_call(
'/api/account/change_details/get.json',
'/api/account/change_details/get.json',
- ...arg
ument
s
+ ...args
)
)
- let api_account_change_details_set = async (...arg
ument
s) => api_call(
+ let api_account_change_details_set = async (...args) => api_call(
'/api/account/change_details/set.json',
'/api/account/change_details/set.json',
- ...arg
ument
s
+ ...args
)
)
- //let api_account_change_details_get_draft = async (...arg
ument
s) => api_call(
+ //let api_account_change_details_get_draft = async (...args) => api_call(
// '/api/account/change_details/get_draft.json',
// '/api/account/change_details/get_draft.json',
- // ...arg
ument
s
+ // ...args
//)
//)
- let api_account_change_details_set_draft = async (...arg
ument
s) => api_call(
+ let api_account_change_details_set_draft = async (...args) => api_call(
'/api/account/change_details/set_draft.json',
'/api/account/change_details/set_draft.json',
- ...arg
ument
s
+ ...args
)
)
- let api_account_change_password = async (...arg
ument
s) => api_call(
+ let api_account_change_password = async (...args) => api_call(
'/api/account/change_password.json',
'/api/account/change_password.json',
- ...arg
ument
s
+ ...args
)
let step_1_dirty = ${JSON.stringify(draft_details !== null)}
)
let step_1_dirty = ${JSON.stringify(draft_details !== null)}
diff --git
a/my_account/password_reset/index.html.jst
b/my_account/password_reset/index.html.jst
index
cc9113d
..
0d9a07f
100644
(file)
--- a/
my_account/password_reset/index.html.jst
+++ b/
my_account/password_reset/index.html.jst
@@
-100,9
+100,9
@@
return async env => {
//script(src="/js/api_call.js") {}
script {
//script(src="/js/api_call.js") {}
script {
- let api_account_password_reset = async (...arg
ument
s) => api_call(
+ let api_account_password_reset = async (...args) => api_call(
'/api/account/password_reset.json',
'/api/account/password_reset.json',
- ...arg
ument
s
+ ...args
)
let step_1 = async () => {
)
let step_1 = async () => {
diff --git
a/my_account/send_verification_email/index.html.jst
b/my_account/send_verification_email/index.html.jst
index
b1a9595
..
e7adb1a
100644
(file)
--- a/
my_account/send_verification_email/index.html.jst
+++ b/
my_account/send_verification_email/index.html.jst
@@
-94,9
+94,9
@@
return async env => {
//script(src="/js/api_call.js") {}
script {
//script(src="/js/api_call.js") {}
script {
- let api_account_sign_up_send_email_verification_link = async (...arg
ument
s) => api_call(
+ let api_account_sign_up_send_email_verification_link = async (...args) => api_call(
'/api/account/sign_up/send_email_verification_link.json',
'/api/account/sign_up/send_email_verification_link.json',
- ...arg
ument
s
+ ...args
)
let step_1 = async () => {
)
let step_1 = async () => {
diff --git
a/my_account/sign_up/index.html.jst
b/my_account/sign_up/index.html.jst
index
d2fe5ac
..
e033251
100644
(file)
--- a/
my_account/sign_up/index.html.jst
+++ b/
my_account/sign_up/index.html.jst
@@
-202,21
+202,21
@@
return async env => {
//script(src="/js/api_call.js") {}
script {
//script(src="/js/api_call.js") {}
script {
- let api_account_sign_up_create_account = async (...arg
ument
s) => api_call(
+ let api_account_sign_up_create_account = async (...args) => api_call(
'/api/account/sign_up/create_account.json',
'/api/account/sign_up/create_account.json',
- ...arg
ument
s
+ ...args
)
)
- //let api_account_sign_up_get_draft = async (...arg
ument
s) => api_call(
+ //let api_account_sign_up_get_draft = async (...args) => api_call(
// '/api/account/sign_up/get_draft.json',
// '/api/account/sign_up/get_draft.json',
- // ...arg
ument
s
+ // ...args
//)
//)
- let api_account_sign_up_set_draft = async (...arg
ument
s) => api_call(
+ let api_account_sign_up_set_draft = async (...args) => api_call(
'/api/account/sign_up/set_draft.json',
'/api/account/sign_up/set_draft.json',
- ...arg
ument
s
+ ...args
)
)
- let api_account_sign_up_send_email_verification_link = async (...arg
ument
s) => api_call(
+ let api_account_sign_up_send_email_verification_link = async (...args) => api_call(
'/api/account/sign_up/send_email_verification_link.json',
'/api/account/sign_up/send_email_verification_link.json',
- ...arg
ument
s
+ ...args
)
let draft_timeout_running = false
)
let draft_timeout_running = false
diff --git
a/my_account/verify_email/index.html.jst
b/my_account/verify_email/index.html.jst
index
7f33b44
..
f0a953f
100644
(file)
--- a/
my_account/verify_email/index.html.jst
+++ b/
my_account/verify_email/index.html.jst
@@
-108,9
+108,9
@@
return async env => {
//script(src="/js/api_call.js") {}
script {
//script(src="/js/api_call.js") {}
script {
- let api_account_sign_up_verify_email = async (...arg
ument
s) => api_call(
+ let api_account_sign_up_verify_email = async (...args) => api_call(
'/api/account/sign_up/verify_email.json',
'/api/account/sign_up/verify_email.json',
- ...arg
ument
s
+ ...args
)
let step_1 = async () => {
)
let step_1 = async () => {
diff --git
a/my_account/verify_password/index.html.jst
b/my_account/verify_password/index.html.jst
index
e20fa28
..
ca1c436
100644
(file)
--- a/
my_account/verify_password/index.html.jst
+++ b/
my_account/verify_password/index.html.jst
@@
-108,9
+108,9
@@
return async env => {
//script(src="/js/api_call.js") {}
script {
//script(src="/js/api_call.js") {}
script {
- let api_account_verify_password = async (...arg
ument
s) => api_call(
+ let api_account_verify_password = async (...args) => api_call(
'/api/account/verify_password.json',
'/api/account/verify_password.json',
- ...arg
ument
s
+ ...args
)
let step_1 = async () => {
)
let step_1 = async () => {