support to update comment status of item

This commit is contained in:
Jacson Passold 2018-08-21 01:39:58 -03:00
parent d21ace3542
commit c3d9808cbe
2 changed files with 8 additions and 5 deletions

View File

@ -92,10 +92,11 @@ export const fetchItemTitle = ({ commit }, id) => {
});
}
export const sendItem = ( { commit }, { collection_id, status }) => {
export const sendItem = ( { commit }, { collection_id, status, comment_status }) => {
return new Promise(( resolve, reject ) => {
axios.tainacan.post('/collection/'+ collection_id + '/items/', {
status: status
status: status,
comment_status: comment_status
})
.then( res => {
commit('setItem', res.data);
@ -108,11 +109,12 @@ export const sendItem = ( { commit }, { collection_id, status }) => {
});
};
export const updateItem = ({ commit }, { item_id, status }) => {
export const updateItem = ({ commit }, { item_id, status, comment_status }) => {
return new Promise((resolve, reject) => {
axios.tainacan.patch('/items/' + item_id, {
status: status
status: status,
comment_status: comment_status
}).then( res => {
commit('setItem', res.data);
commit('setLastUpdated');

View File

@ -9,7 +9,8 @@ const state = {
itemTitle: '',
attachment: {},
attachments: [],
lastUpdated: ''
lastUpdated: '',
comment_status: ''
};