Skip to content

Commit

Permalink
refactored front end services per latest main
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterOu8 committed Nov 7, 2024
1 parent 4a0bb97 commit b29b230
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions blotztask-ui/src/services/taskService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const fetchTaskItemsDueToday = async (): Promise<TaskDTO[]> => {
//Converting today's date to ISO String format
const date = new Date().toISOString().split('T')[0];

const response = await fetchWithAuth(
const result = await fetchWithAuth<TaskItemDTO[]>(
`${process.env.NEXT_PUBLIC_API_BASE_URL_WITH_API}/Task/due-date/${date}`,
{
method: 'GET',
Expand All @@ -30,10 +30,5 @@ export const fetchTaskItemsDueToday = async (): Promise<TaskDTO[]> => {
}
);

if (!response.ok) {
throw new Error('Error in fetching Task Item from backend');
}

const data: TaskDTO[] = await response.json();
return data;
return result;
};

0 comments on commit b29b230

Please sign in to comment.