Updates sidebar on dashboard

This commit is contained in:
Nithin David
2020-02-11 19:21:55 +05:30
parent 30f4c08143
commit 6186d14593
20 changed files with 394 additions and 112 deletions

View File

@@ -6,6 +6,8 @@ const state = {
records: {},
uiFlags: {
isFetching: false,
isUpdating: false,
isError: false,
},
};
@@ -38,6 +40,30 @@ export const actions = {
});
}
},
update: async ({ commit }, { conversationId, labels }) => {
commit(types.default.SET_CONVERSATION_LABELS_UI_FLAG, {
isUpdating: true,
});
try {
const response = await ConversationAPI.updateLabels(
conversationId,
labels
);
commit(types.default.SET_CONVERSATION_LABELS, {
id: conversationId,
data: response.data.payload,
});
commit(types.default.SET_CONVERSATION_LABELS_UI_FLAG, {
isUpdating: false,
isError: false,
});
} catch (error) {
commit(types.default.SET_CONVERSATION_LABELS_UI_FLAG, {
isUpdating: false,
isError: true,
});
}
},
};
export const mutations = {