From 89abb207b31a2e704473447190e815172a3e0733 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Fri, 8 Nov 2019 10:29:55 -0300 Subject: [PATCH] Finishes Filter by Author on Activities list. #330. --- src/admin/pages/lists/activities-page.vue | 10 +++-- .../scss/_dropdown-and-autocomplete.scss | 4 ++ src/js/store/modules/activity/actions.js | 42 +++---------------- 3 files changed, 16 insertions(+), 40 deletions(-) diff --git a/src/admin/pages/lists/activities-page.vue b/src/admin/pages/lists/activities-page.vue index a0d2212fa..bffbd1b33 100644 --- a/src/admin/pages/lists/activities-page.vue +++ b/src/admin/pages/lists/activities-page.vue @@ -85,9 +85,10 @@ .control.has-icons-left .icon { + height: 2.125rem; + width: 2.125rem; + } .dropdown-menu { padding: 0px; margin-top: 0; diff --git a/src/js/store/modules/activity/actions.js b/src/js/store/modules/activity/actions.js index fbd3d33df..e01738345 100644 --- a/src/js/store/modules/activity/actions.js +++ b/src/js/store/modules/activity/actions.js @@ -21,18 +21,8 @@ export const fetchActivities = ({ commit }, { page, activitiesPerPage, search, s endpoint += '&' + qs.stringify(dateQuery); } - if (authorId != undefined && authorId != null) { - let metaQuery = { - metaquery: [ - { - value: authorId, - key: 'user_id', - compare: '=' - } - ] - }; - endpoint += '&' + qs.stringify(metaQuery); - } + if (authorId != undefined && authorId != null) + endpoint += '&authorid=' + authorId; return new Promise((resolve, reject) => { axios.tainacan.get(endpoint) @@ -70,18 +60,8 @@ export const fetchCollectionActivities = ({ commit }, { page, activitiesPerPage, endpoint += '&' + qs.stringify(dateQuery); } - if (authorId != undefined && authorId != null) { - let metaQuery = { - metaquery: [ - { - value: authorId, - key: 'user_id', - compare: '=' - } - ] - }; - endpoint += '&' + qs.stringify(metaQuery); - } + if (authorId != undefined && authorId != null) + endpoint += '&authorid=' + authorId; return new Promise((resolve, reject) => { axios.tainacan.get(endpoint) @@ -106,18 +86,8 @@ export const fetchItemActivities = ({ commit }, { page, activitiesPerPage, itemI if (search != undefined && search != '') endpoint += `&search=${search}`; - if (authorId != undefined && authorId != null) { - let metaQuery = { - metaquery: [ - { - value: authorId, - key: 'user_id', - compare: '=' - } - ] - }; - endpoint += '&' + qs.stringify(metaQuery); - } + if (authorId != undefined && authorId != null) + endpoint += '&authorid=' + authorId; if (searchDates && searchDates[0] != null && searchDates[1] != null) { let dateQuery = {