We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37a0f7f commit 1c4a7c6Copy full SHA for 1c4a7c6
2 files changed
app/assets/javascripts/qpixel_api.js
@@ -238,13 +238,9 @@ window.QPixel = {
238
239
const data = await resp.json();
240
241
- if (data.status !== 'success') {
242
- console.error(`Preference persist failed (${name})`);
243
- console.error(resp);
244
- }
245
- else {
+ QPixel.handleJSONResponse(data, (data) => {
246
QPixel._updatePreferencesLocally(data.preferences);
247
+ });
248
},
249
250
filters: async () => {
app/controllers/users_controller.rb
@@ -198,6 +198,7 @@ def set_preference
198
preferences: current_user.preferences }
199
else
200
render json: { status: 'failed',
201
+ message: 'Failed to save the preference',
202
errors: ['Both name and value parameters are required'] },
203
status: 400
204
end
0 commit comments