Commit 392ca150 authored by Natalia Tepluhina's avatar Natalia Tepluhina Committed by Martin Wortschack

Resolve "Improve format support message in issue design"

parent 5ea31b5a
---
title: Resolve Improve format support message in issue design
merge_request: 27409
author:
type: fixed
......@@ -4,7 +4,6 @@ import {
ADD_IMAGE_DIFF_NOTE_ERROR,
UPDATE_IMAGE_DIFF_NOTE_ERROR,
ADD_DISCUSSION_COMMENT_ERROR,
UPLOAD_DESIGN_ERROR,
designDeletionError,
} from './error_messages';
......@@ -292,7 +291,7 @@ export const updateStoreAfterUpdateImageDiffNote = (store, data, query, queryVar
export const updateStoreAfterUploadDesign = (store, data, query) => {
if (hasErrors(data)) {
onError(data, UPLOAD_DESIGN_ERROR);
onError(data, data.errors[0]);
} else {
addNewDesignToStore(store, data, query);
}
......
......@@ -10,7 +10,6 @@ import {
designDeletionError,
ADD_DISCUSSION_COMMENT_ERROR,
ADD_IMAGE_DIFF_NOTE_ERROR,
UPLOAD_DESIGN_ERROR,
UPDATE_IMAGE_DIFF_NOTE_ERROR,
} from 'ee/design_management/utils/error_messages';
import design from '../mock_data/design';
......@@ -33,7 +32,7 @@ describe('Design Management cache update', () => {
${'updateStoreAfterDesignsDelete'} | ${updateStoreAfterDesignsDelete} | ${designDeletionError({ singular: true })} | ${[[design]]}
${'updateStoreAfterAddDiscussionComment'} | ${updateStoreAfterAddDiscussionComment} | ${ADD_DISCUSSION_COMMENT_ERROR} | ${[]}
${'updateStoreAfterAddImageDiffNote'} | ${updateStoreAfterAddImageDiffNote} | ${ADD_IMAGE_DIFF_NOTE_ERROR} | ${[]}
${'updateStoreAfterUploadDesign'} | ${updateStoreAfterUploadDesign} | ${UPLOAD_DESIGN_ERROR} | ${[]}
${'updateStoreAfterUploadDesign'} | ${updateStoreAfterUploadDesign} | ${mockErrors[0]} | ${[]}
${'updateStoreAfterUpdateImageDiffNote'} | ${updateStoreAfterUpdateImageDiffNote} | ${UPDATE_IMAGE_DIFF_NOTE_ERROR} | ${[]}
`('$fnName handles errors in response', ({ subject, extraArgs, errorMessage }) => {
expect(createFlash).not.toHaveBeenCalled();
......
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