www/js/profile_water.js

changeset 768
ae1195153fa2
parent 702
f0896a6f9b64
child 785
aa79acfdf8a9
equal deleted inserted replaced
767:08c0343b622b 768:ae1195153fa2
1 /***************************************************************************** 1 /*****************************************************************************
2 * Copyright (C) 2014-2020 2 * Copyright (C) 2014-2021
3 * 3 *
4 * Michiel Broek <mbroek at mbse dot eu> 4 * Michiel Broek <mbroek at mbse dot eu>
5 * 5 *
6 * This file is part of Brewery Management System 6 * This file is part of Brewery Management System
7 * 7 *
71 dataType: 'json', 71 dataType: 'json',
72 url: url, 72 url: url,
73 cache: false, 73 cache: false,
74 data: data, 74 data: data,
75 type: 'POST', 75 type: 'POST',
76 success: function(data, status, xhr) { 76 success: function(data) {
77 commit(true); 77 if (data.error) {
78 console.log('delete: ' + data.msg);
79 alert('Fout: ' + data.msg);
80 } else {
81 console.log('delete: success');
82 }
78 location.reload(true); 83 location.reload(true);
79 }, 84 },
80 error: function(jqXHR, textStatus, errorThrown) { commit(false); } 85 error: function(jqXHR, textStatus, errorThrown) { commit(false); }
81 }); 86 });
82 }, 87 },
86 dataType: 'json', 91 dataType: 'json',
87 url: url, 92 url: url,
88 cache: false, 93 cache: false,
89 data: data, 94 data: data,
90 type: 'POST', 95 type: 'POST',
91 success: function(data, status, xhr) { 96 success: function(data) {
92 commit(true); 97 if (data.error) {
98 console.log('insert: ' + data.msg);
99 alert('Fout: ' + data.msg);
100 } else {
101 console.log('insert: success');
102 }
93 location.reload(true); 103 location.reload(true);
94 }, 104 },
95 error: function(jqXHR, textStatus, errorThrown) { commit(false); } 105 error: function(jqXHR, textStatus, errorThrown) { commit(false); }
96 }); 106 });
97 }, 107 },
101 dataType: 'json', 111 dataType: 'json',
102 url: url, 112 url: url,
103 cache: false, 113 cache: false,
104 data: data, 114 data: data,
105 type: 'POST', 115 type: 'POST',
106 success: function(data, status, xhr) { 116 success: function(data) {
107 commit(true); 117 if (data.error) {
118 console.log('updaterow: ' + data.msg);
119 alert('Fout: ' + data.msg);
120 } else {
121 console.log('updaterow: success');
122 }
108 location.reload(true); 123 location.reload(true);
109 }, 124 },
110 error: function(jqXHR, textStatus, errorThrown) { commit(false); } 125 error: function(jqXHR, textStatus, errorThrown) { commit(false); }
111 }); 126 });
112 } 127 }

mercurial