add getCollectionCommentStatus helper for Item edit/View
This commit is contained in:
parent
1e52496dfe
commit
d21ace3542
|
@ -147,6 +147,20 @@ export const fetchCollectionName = ({ commit }, id) => {
|
|||
});
|
||||
};
|
||||
|
||||
export const fetchCollectionCommentStatus = ({ commit }, id) => {
|
||||
return new Promise((resolve, reject) =>{
|
||||
axios.tainacan.get('/collections/' + id + '?fetch_only=comment_status')
|
||||
.then(res => {
|
||||
let collectionCommentStatus = res.data;
|
||||
commit('setCollectionCommentStatus', collectionCommentStatus.comment_status);
|
||||
resolve( collectionCommentStatus.comment_status );
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error);
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
export const fetchCollectionNameAndURL = ({ commit }, id) => {
|
||||
//commit('cleanCollectionName');
|
||||
return new Promise((resolve, reject) =>{
|
||||
|
|
|
@ -25,3 +25,7 @@ export const getCollectionURL = state => {
|
|||
export const getAttachments = state => {
|
||||
return state.attachments;
|
||||
}
|
||||
|
||||
export const getCollectionCommentStatus = state => {
|
||||
return state.collectionCommentStatus;
|
||||
}
|
|
@ -10,7 +10,8 @@ const state = {
|
|||
collection: null,
|
||||
collectionName: '',
|
||||
collectionURL: '',
|
||||
attachments: []
|
||||
attachments: [],
|
||||
collectionCommentStatus: ''
|
||||
};
|
||||
|
||||
export default {
|
||||
|
|
|
@ -69,4 +69,12 @@ export const setAttachments = ( state, attachments ) => {
|
|||
|
||||
export const cleanAttachments = (state) => {
|
||||
state.attachments = [];
|
||||
}
|
||||
|
||||
export const setCollectionCommentStatus = (state, collectionCommentStatus) => {
|
||||
state.collectionCommentStatus = collectionCommentStatus;
|
||||
}
|
||||
|
||||
export const cleanCollectionCommentStatus = (state) => {
|
||||
state.collectionCommentStatus = '';
|
||||
}
|
Loading…
Reference in New Issue