Skip to content

Commit

Permalink
fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarkowsky committed Aug 12, 2024
1 parent 463e983 commit 7b1bca2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion react-app/src/hooks/api/useBuildingsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const useBuildingsApi = (absoluteFetch: IFetch) => {
Object.fromEntries(Object.entries(params).filter(([_, v]) => v != null))
: undefined;
const { parsedBody } = await absoluteFetch.get('/buildings', noNullParam);
if (parsedBody.error) {
if ((parsedBody as Record<string, any>).error) {
return [];
}
return parsedBody as Building[];
Expand Down
4 changes: 2 additions & 2 deletions react-app/src/hooks/api/useParcelsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ const useParcelsApi = (absoluteFetch: IFetch) => {
Object.fromEntries(Object.entries(params).filter(([_, v]) => v != null))
: undefined;
const { parsedBody } = await absoluteFetch.get('/parcels', noNullParam);
if (parsedBody.error) {
if ((parsedBody as Record<string, any>).error) {
return [];
}
return parsedBody as Parcel[];
};
const getParcelsWithRelations = async () => {
const { parsedBody } = await absoluteFetch.get('/parcels?includeRelations=true');
if (parsedBody.error) {
if ((parsedBody as Record<string, any>).error) {
return [];
}
return parsedBody as Parcel[];
Expand Down
2 changes: 1 addition & 1 deletion react-app/src/hooks/api/useProjectsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ const useProjectsApi = (absoluteFetch: IFetch) => {
},
{ signal },
);
if (parsedBody.error) {
if ((parsedBody as Record<string, any>).error) {
return [];
}
return parsedBody as Project[];
Expand Down
2 changes: 1 addition & 1 deletion react-app/src/hooks/api/usePropertiesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const usePropertiesApi = (absoluteFetch: IFetch) => {
},
{ signal },
);
if (parsedBody.error) {
if ((parsedBody as Record<string, any>).error) {
return [];
}
return parsedBody as (Parcel | Building)[];
Expand Down
2 changes: 1 addition & 1 deletion react-app/src/hooks/api/useUsersApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const useUsersApi = (absoluteFetch: IFetch) => {
};
const getAllUsers = async (sort: CommonFiltering, signal?: AbortSignal) => {
const { parsedBody } = await absoluteFetch.get('/users', sort, { signal });
if (parsedBody.error) {
if ((parsedBody as Record<string, any>).error) {
return [] as User[];
}
return parsedBody as User[];
Expand Down
4 changes: 3 additions & 1 deletion react-app/src/pages/BulkUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ const BulkUpload = () => {
submit(file).then((resp) => {
if (resp && resp.ok) {
setFile(null);
setFileProgress(resp.parsedBody?.CompletionPercentage ?? 0);
setFileProgress(
(resp.parsedBody as Record<string, any>)?.CompletionPercentage ?? 0,
);
}
})
}
Expand Down

0 comments on commit 7b1bca2

Please sign in to comment.