equal
deleted
inserted
replaced
66 fetch = (req) => { |
66 fetch = (req) => { |
67 return new Promise((resolve, reject) => { |
67 return new Promise((resolve, reject) => { |
68 fetch(req) |
68 fetch(req) |
69 .then((response) => { |
69 .then((response) => { |
70 if (response.ok) { |
70 if (response.ok) { |
71 return response.json().then((data) => resolve(data)); |
71 let resJsonPromise; |
|
72 if(response.status === 204) { |
|
73 resJsonPromise = Promise.resolve({}); |
|
74 } else { |
|
75 resJsonPromise = response.json(); |
|
76 } |
|
77 return resJsonPromise.then((data) => resolve(data)); |
|
78 |
72 } else { |
79 } else { |
73 return response.json().then((data) => reject(data)); |
80 return response.json().then((data) => reject(data)); |
74 } |
81 } |
75 }); |
82 }); |
76 }); |
83 }); |