From b3f6bbe7f3fb946029f61c6342603a4b4ef83182 Mon Sep 17 00:00:00 2001 From: "Huy Tran (Harry)" Date: Mon, 17 May 2021 06:22:44 +1000 Subject: [PATCH] fix: Set Planter Manager not update the selfie without Tree Manager Role (#83) * feat: set planter manager not update the selfie without tree manager role * feat: change name of planter selfies query --- src/api/planters.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/api/planters.js b/src/api/planters.js index 17aee2c2b..5b06f7f78 100644 --- a/src/api/planters.js +++ b/src/api/planters.js @@ -83,14 +83,15 @@ export default { order: 'timeUpdated DESC', limit: 100, fields: ['planterPhotoUrl'], - where: { planterId, planterPhotoUrl: { neq: null } }, }; - const treeQuery = `${ + const planterSelfiesQuery = `${ process.env.REACT_APP_API_ROOT - }/api/${getOrganization()}trees/?filter=${JSON.stringify(filter)}`; + }/api/${getOrganization()}planter/${planterId}/selfies/?filter=${JSON.stringify( + filter, + )}`; - return fetch(treeQuery, { + return fetch(planterSelfiesQuery, { method: 'GET', headers: { 'content-type': 'application/json',