fix: Could not able to create label (#4161)

* fixes: Could not able to create label

* review fixes

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Sivin Varghese
2022-03-14 20:43:56 +05:30
committed by GitHub
parent 4a2452173e
commit b3ba8b9513
2 changed files with 12 additions and 11 deletions

View File

@@ -45,7 +45,8 @@ export const actions = {
const response = await LabelsAPI.create(cannedObj);
commit(types.ADD_LABEL, response.data);
} catch (error) {
throw new Error(error);
const errorMessage = error?.response?.data?.message;
throw new Error(errorMessage);
} finally {
commit(types.SET_LABEL_UI_FLAG, { isCreating: false });
}