mirror of
https://github.com/Sea-Haven-Industries/meal-order-manager.git
synced 2026-09-30 05:23:13 +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
|
||||
else '''async function loadRoster() {{
|
||||
try {{
|
||||
else '''async function loadRoster() {
|
||||
try {
|
||||
const res = await fetch(ROSTER_URL);
|
||||
const data = await res.json();
|
||||
const select = document.getElementById('emp-name');
|
||||
select.innerHTML = '<option value="">Select your name</option>';
|
||||
(data.employees || ROSTER).forEach(emp => {{
|
||||
(data.employees || ROSTER).forEach(emp => {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = emp.name;
|
||||
opt.dataset.email = emp.email;
|
||||
opt.textContent = emp.name;
|
||||
select.appendChild(opt);
|
||||
}});
|
||||
select.addEventListener('change', () => {{
|
||||
});
|
||||
select.addEventListener('change', () => {
|
||||
const selected = select.options[select.selectedIndex];
|
||||
document.getElementById('emp-email').value = selected?.dataset?.email || '';
|
||||
}});
|
||||
}} catch (e) {{
|
||||
});
|
||||
} catch (e) {
|
||||
const select = document.getElementById('emp-name');
|
||||
select.innerHTML = '<option value="">Select your name</option>';
|
||||
ROSTER.forEach(emp => {{
|
||||
ROSTER.forEach(emp => {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = emp.name;
|
||||
opt.dataset.email = emp.email;
|
||||
opt.textContent = emp.name;
|
||||
select.appendChild(opt);
|
||||
}});
|
||||
}}
|
||||
}}
|
||||
});
|
||||
}
|
||||
}
|
||||
'''
|
||||
}
|
||||
async function checkFormStatus() {{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue