You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
async function serverSideData(params) {
const { captureid } = params;
const tree = await getCapturesById(captureid);
const { planting_organization_id, grower_account_id, lat, lon } = tree;
const grower = await getGrowerById(grower_account_id);
const country = await getCountryByLatLon(lat, lon);
let organization; // = await getStakeHolderById(planting_organization_id);
if (planting_organization_id) {
log.warn('load org from planting_orgniazation_id');
organization = await getStakeHolderById(planting_organization_id);
} else if (grower.organization_id) {
log.warn('load org from planter. organization_id');
organization = await getStakeHolderById(grower.organization_id);
} else {
log.warn('can not load org for tree:', tree, grower);
}
return {
tree,
grower,
organization,
country,
};
}
we are already using the getStakeHolderById function to fetch the stakeholder if planting_organization_id is null
@dadiorchen the handling is already done, is there any thing else that needs to be changed in the code
yunchipang
changed the title
Implement the organzation component in the /catpure page
Implement the organzation component in the /capture page
Nov 2, 2024
The capture page, here the
planting organization
is wrong:We need to use the stakeholder endpoint in
query
API to fetch the stakeholder, (organization here)https://github.com/Greenstand/treetracker-query-api/blob/ebf9d2cf474fc5ed8479809d54140ce5f80e3170/docs/api/spec/query-api.yaml#L273-L284
Please write the integration test and mock the data, please verify the organization info on the result page (the info return from your mock object)
The text was updated successfully, but these errors were encountered: