diff --git a/ui/src/routes/WorkingHours.svelte b/ui/src/routes/WorkingHours.svelte index f9a726e..7ce8567 100644 --- a/ui/src/routes/WorkingHours.svelte +++ b/ui/src/routes/WorkingHours.svelte @@ -52,19 +52,17 @@ console.log(err); }); }, - 'add': record => { + 'add': async record => { console.log(record); // noinspection JSUnresolvedVariable - fetch(env.API_URL + '/working-hours', { + await fetch(env.API_URL + '/working-hours', { method: 'POST', - mode: 'no-cors', + mode: 'cors', cache: 'no-cache', - credentials: 'same-origin', + credentials: 'omit', headers: { 'Content-Type': 'application/json' }, - redirect: 'follow', - referrerPolicy: 'no-referrer', body: JSON.stringify(record) }) .then(res => { @@ -79,19 +77,17 @@ console.log(err); }); }, - 'update': (date, record) => { + 'update': async (date, record) => { console.log(record); // noinspection JSUnresolvedVariable - fetch(env.API_URL + '/working-hours/' + date, { + await fetch(env.API_URL + '/working-hours/' + date, { method: 'PUT', - mode: 'no-cors', + mode: 'cors', cache: 'no-cache', - credentials: 'same-origin', + credentials: 'omit', headers: { 'Content-Type': 'application/json' }, - redirect: 'follow', - referrerPolicy: 'no-referrer', body: JSON.stringify(record) }) .then(res => {