Skip to content

Commit

Permalink
make model consistent with anissa
Browse files Browse the repository at this point in the history
  • Loading branch information
sdevalapurkar committed Jun 17, 2021
1 parent b30628e commit 5c48d79
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/src/features/observations/BlockObservationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ const BlockObservationPage = () => {
}

setObservationWithDetails(observationWithDetailsResponse.data.metaData);
setTableData(observationWithDetailsResponse.data.tableData);
setTableData(observationWithDetailsResponse.data.tableData.data);
}, [biohubApi.observation, urlParams]);

console.log(tableData);

useEffect(() => {
if (isLoadingProject && !projectWithDetails) {
getProject();
Expand Down
6 changes: 5 additions & 1 deletion app/src/interfaces/useObservationApi.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ export interface IGetObservationsListResponse {
*/
export interface ICreateObservationRequest {
metaData: IBlockObservationForm;
tableData: any[][];
tableData: IBlockObservationTableData;
}

export interface IBlockObservationTableData {
data: string[][];
}

/**
Expand Down
4 changes: 3 additions & 1 deletion app/src/test-helpers/observation-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export const getObservationForUpdateResponse: IGetObservationResponse = {
aircraft_gps_datum: 'NAD27',
aircraft_gps_readout: 'UTM'
},
tableData: [[null, 1, 1, null, null, null, null, null, null, null, null, null, null, null]]
tableData: {
data: [['', '1', '1', '', '', '', '', '', '', '', '', '', '', '']]
}
}
};

0 comments on commit 5c48d79

Please sign in to comment.