www/js/inv_miscs.js

changeset 767
08c0343b622b
parent 702
f0896a6f9b64
child 785
aa79acfdf8a9
equal deleted inserted replaced
766:86289b0c4a27 767:08c0343b622b
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 *
91 dataType: 'json', 91 dataType: 'json',
92 url: url, 92 url: url,
93 cache: false, 93 cache: false,
94 data: data, 94 data: data,
95 type: 'POST', 95 type: 'POST',
96 success: function(data, status, xhr) { 96 success: function(data) {
97 commit(true); 97 if (data.error) {
98 console.log('delete: ' + data.msg);
99 alert('Fout: ' + data.msg);
100 } else {
101 console.log('delete: success');
102 }
98 location.reload(true); 103 location.reload(true);
99 }, 104 },
100 error: function(jqXHR, textStatus, errorThrown) { commit(false); } 105 error: function(jqXHR, textStatus, errorThrown) { commit(false); }
101 }); 106 });
102 }, 107 },
106 dataType: 'json', 111 dataType: 'json',
107 url: url, 112 url: url,
108 cache: false, 113 cache: false,
109 data: data, 114 data: data,
110 type: 'POST', 115 type: 'POST',
111 success: function(data, status, xhr) { 116 success: function(data) {
112 commit(true); 117 if (data.error) {
118 console.log('insert: ' + data.msg);
119 alert('Fout: ' + data.msg);
120 } else {
121 console.log('insert: success');
122 }
113 location.reload(true); 123 location.reload(true);
114 }, 124 },
115 error: function(jqXHR, textStatus, errorThrown) { commit(false); } 125 error: function(jqXHR, textStatus, errorThrown) { commit(false); }
116 }); 126 });
117 }, 127 },
121 dataType: 'json', 131 dataType: 'json',
122 url: url, 132 url: url,
123 cache: false, 133 cache: false,
124 data: data, 134 data: data,
125 type: 'POST', 135 type: 'POST',
126 success: function(data, status, xhr) { 136 success: function(data) {
127 commit(true); 137 if (data.error) {
138 console.log('updaterow: ' + data.msg);
139 alert('Fout: ' + data.msg);
140 } else {
141 console.log('updaterow: success');
142 }
128 location.reload(true); 143 location.reload(true);
129 }, 144 },
130 error: function(jqXHR, textStatus, errorThrown) { commit(false); } 145 error: function(jqXHR, textStatus, errorThrown) { commit(false); }
131 }); 146 });
132 } 147 }

mercurial