Skip to content

Commit

Permalink
fix(home): update ts types for home
Browse files Browse the repository at this point in the history
  • Loading branch information
NSUWAL123 committed Jan 3, 2025
1 parent 07e09d8 commit 112ebe0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/frontend/src/api/HomeService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import axios from 'axios';
import { HomeActions } from '@/store/slices/HomeSlice';
import { homeProjectPaginationTypes, projectType } from '@/models/home/homeModel';

export const HomeSummaryService: Function = (url: string) => {
return async (dispatch) => {
Expand All @@ -8,8 +9,8 @@ export const HomeSummaryService: Function = (url: string) => {
const fetchHomeSummaries = async (url: string) => {
try {
const fetchHomeData = await axios.get(url);
const projectSummaries: any = fetchHomeData.data.results;
const paginationResp = fetchHomeData.data.pagination;
const projectSummaries: projectType[] = fetchHomeData.data.results;
const paginationResp: homeProjectPaginationTypes = fetchHomeData.data.pagination;
dispatch(HomeActions.SetHomeProjectPagination(paginationResp));
dispatch(HomeActions.SetHomeProjectSummary(projectSummaries));
dispatch(HomeActions.HomeProjectLoading(false));
Expand Down
5 changes: 1 addition & 4 deletions src/frontend/src/models/home/homeModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ export type projectType = {
organisation_id: number;
organisation_logo: string | null;
priority: number;
tasks_bad: number;
tasks_mapped: number;
tasks_validated: number;
total_tasks: number;
outline: { type: string; coordinates: number[][] };
};

export type snackbarTypes = {
Expand Down
2 changes: 0 additions & 2 deletions src/frontend/src/store/types/IHome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ export type HomeStateTypes = {
homeProjectSummary: projectType[];
selectedProject: projectType | {};
homeProjectLoading: boolean;
dialogStatus: boolean;
snackbar: snackbarTypes;
showMapStatus: boolean;
projectCentroidLoading: boolean;
homeProjectPagination: homeProjectPaginationTypes;
};

0 comments on commit 112ebe0

Please sign in to comment.