mirror of
https://github.com/Sea-Haven-Industries/meal-order-manager.git
synced 2026-10-07 12:48:54 +00:00
fix: use single braces in loadRoster JS nested string
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
b1530c04a2
commit
26e1f5bbb4
1 changed files with 11 additions and 11 deletions
|
|
@ -514,35 +514,35 @@ function updateTotal() {{
|
||||||
{
|
{
|
||||||
""
|
""
|
||||||
if use_google_auth
|
if use_google_auth
|
||||||
else '''async function loadRoster() {{
|
else '''async function loadRoster() {
|
||||||
try {{
|
try {
|
||||||
const res = await fetch(ROSTER_URL);
|
const res = await fetch(ROSTER_URL);
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
const select = document.getElementById('emp-name');
|
const select = document.getElementById('emp-name');
|
||||||
select.innerHTML = '<option value="">Select your name</option>';
|
select.innerHTML = '<option value="">Select your name</option>';
|
||||||
(data.employees || ROSTER).forEach(emp => {{
|
(data.employees || ROSTER).forEach(emp => {
|
||||||
const opt = document.createElement('option');
|
const opt = document.createElement('option');
|
||||||
opt.value = emp.name;
|
opt.value = emp.name;
|
||||||
opt.dataset.email = emp.email;
|
opt.dataset.email = emp.email;
|
||||||
opt.textContent = emp.name;
|
opt.textContent = emp.name;
|
||||||
select.appendChild(opt);
|
select.appendChild(opt);
|
||||||
}});
|
});
|
||||||
select.addEventListener('change', () => {{
|
select.addEventListener('change', () => {
|
||||||
const selected = select.options[select.selectedIndex];
|
const selected = select.options[select.selectedIndex];
|
||||||
document.getElementById('emp-email').value = selected?.dataset?.email || '';
|
document.getElementById('emp-email').value = selected?.dataset?.email || '';
|
||||||
}});
|
});
|
||||||
}} catch (e) {{
|
} catch (e) {
|
||||||
const select = document.getElementById('emp-name');
|
const select = document.getElementById('emp-name');
|
||||||
select.innerHTML = '<option value="">Select your name</option>';
|
select.innerHTML = '<option value="">Select your name</option>';
|
||||||
ROSTER.forEach(emp => {{
|
ROSTER.forEach(emp => {
|
||||||
const opt = document.createElement('option');
|
const opt = document.createElement('option');
|
||||||
opt.value = emp.name;
|
opt.value = emp.name;
|
||||||
opt.dataset.email = emp.email;
|
opt.dataset.email = emp.email;
|
||||||
opt.textContent = emp.name;
|
opt.textContent = emp.name;
|
||||||
select.appendChild(opt);
|
select.appendChild(opt);
|
||||||
}});
|
});
|
||||||
}}
|
}
|
||||||
}}
|
}
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
async function checkFormStatus() {{
|
async function checkFormStatus() {{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue