Capture accumulated application, UI, CLI, regression tests and design documentation changes, including task project mapping and default CalDAV list naming. Keep deployment data, backups, local credentials and build artifacts out of Git. Move the Compose enrollment token to an ignored local environment file.
21 lines
1004 B
JavaScript
21 lines
1004 B
JavaScript
document.addEventListener('DOMContentLoaded', () => {
|
|
const form = document.querySelector('[data-city-path-form]');
|
|
if (!form) return;
|
|
form.addEventListener('submit', async (event) => {
|
|
event.preventDefault();
|
|
const result = form.querySelector('[data-city-path-result]');
|
|
const type = form.dataset.kind === 'spot' ? 'spots' : 'zones';
|
|
const response = await fetch(`/_/api/v1/city/${type}/${encodeURIComponent(form.dataset.uuid)}`, {
|
|
method: 'PATCH',
|
|
headers: {'Content-Type': 'application/json'},
|
|
body: JSON.stringify({kind: form.dataset.kind, path_prefix: form.elements.path_prefix.value}),
|
|
});
|
|
if (!response.ok) {
|
|
const data = await response.json().catch(() => ({}));
|
|
result.textContent = data.error || `HTTP ${response.status}`;
|
|
return;
|
|
}
|
|
result.textContent = document.documentElement.lang.startsWith('ja') ? '保存しました' : 'Saved';
|
|
});
|
|
});
|