Commit cf6420d4 authored by Laurent Deketelaere's avatar Laurent Deketelaere Committed by Peter Hegman

Fix flash color when there is an error

Display flash `ALERT` when profile submit response status equals `error`

Changelog: fixed
parent 06394349
import $ from 'jquery'; import $ from 'jquery';
import createFlash from '~/flash'; import createFlash, { FLASH_TYPES } from '~/flash';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { parseBoolean } from '~/lib/utils/common_utils'; import { parseBoolean } from '~/lib/utils/common_utils';
import { Rails } from '~/lib/utils/rails_ujs'; import { Rails } from '~/lib/utils/rails_ujs';
...@@ -86,7 +86,7 @@ export default class Profile { ...@@ -86,7 +86,7 @@ export default class Profile {
createFlash({ createFlash({
message: data.message, message: data.message,
type: 'notice', type: data.status === 'error' ? FLASH_TYPES.ALERT : FLASH_TYPES.NOTICE,
}); });
}) })
.then(() => { .then(() => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment