Die Abfragen werden erfolgreich vom Server verarbeitet.
This commit is contained in:
@@ -52,19 +52,17 @@
|
|||||||
console.log(err);
|
console.log(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
'add': record => {
|
'add': async record => {
|
||||||
console.log(record);
|
console.log(record);
|
||||||
// noinspection JSUnresolvedVariable
|
// noinspection JSUnresolvedVariable
|
||||||
fetch(env.API_URL + '/working-hours', {
|
await fetch(env.API_URL + '/working-hours', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
mode: 'no-cors',
|
mode: 'cors',
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
credentials: 'same-origin',
|
credentials: 'omit',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
redirect: 'follow',
|
|
||||||
referrerPolicy: 'no-referrer',
|
|
||||||
body: JSON.stringify(record)
|
body: JSON.stringify(record)
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
@@ -79,19 +77,17 @@
|
|||||||
console.log(err);
|
console.log(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
'update': (date, record) => {
|
'update': async (date, record) => {
|
||||||
console.log(record);
|
console.log(record);
|
||||||
// noinspection JSUnresolvedVariable
|
// noinspection JSUnresolvedVariable
|
||||||
fetch(env.API_URL + '/working-hours/' + date, {
|
await fetch(env.API_URL + '/working-hours/' + date, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
mode: 'no-cors',
|
mode: 'cors',
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
credentials: 'same-origin',
|
credentials: 'omit',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
redirect: 'follow',
|
|
||||||
referrerPolicy: 'no-referrer',
|
|
||||||
body: JSON.stringify(record)
|
body: JSON.stringify(record)
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
|||||||
Reference in New Issue
Block a user