Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/api/services/enrollment.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// src/api/services/enrollment.service.ts

import type { Enrollment, EnrollmentState } from '../../types/entities';
import type { ApiResponse } from '../../types/shared';
import apiClient from '../apiClient';
Expand Down
4 changes: 0 additions & 4 deletions src/components/ui/CardList/CardList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ export interface CourseCardListProps extends React.HTMLAttributes<HTMLDivElement
* The complete course object containing the information to be displayed (title, price, instructor, image, etc.).
*/
course: Course;
/**
* Optional function that runs when secondary actions are clicked (if any exist).
*/
onViewMore?: () => void;
}
/**
* Horizontal card component used to display a summary of a course in lists.
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useAppeals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { appealService } from '../api/services/appeal.service';
import type { SearchAppealsParams, PaginatedAppealsResponse } from '../types/shared.ts';
import type { Appeal } from '../types/entities.ts';
import type { AxiosError } from 'axios';
import { useAuth } from './useAuth';
import { useAuth } from './useAuth.ts';

export const useAppeals = (params: SearchAppealsParams = {}) => {
const { isAuthenticated } = useAuth();
Expand Down
5 changes: 0 additions & 5 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,8 @@ const queryClient = new QueryClient({
const axiosError = error as AxiosError<ApiErrorResponse>;

const status = axiosError.response?.status;
const backendMessage = axiosError.response?.data?.message;
const backendErrors = axiosError.response?.data?.errors;

if (backendMessage) {
toast.error(backendMessage);
return;
}
if (typeof backendErrors === 'string') {
toast.error(backendErrors);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ContactPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function ContactPage() {
Error al Enviar el Mensaje
</h4>
<p className="text-sm text-red-700">
{contactMutation.error?.response?.data?.message ||
{contactMutation.error?.response?.data?.errors ||
'Ocurrió un error al enviar tu mensaje. Por favor, intenta nuevamente.'}
</p>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Course/CourseDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,16 @@ function CourseDetails() {
</Link>
</div>

{course?.professor?.institution ? (
{course.institution?.institutionId ? (
<div className="ml-6">
<p className="text-sm text-slate-600">Institución</p>
<Link
to={`/courses?institutionId=${
course.professor.institution.id || ''
course.institution?.institutionId
}`}
className="font-semibold text-slate-800 hover:text-blue-600 transition-colors"
>
{course.professor.institution?.name}
{course.institution?.name}
</Link>
</div>
) : null}
Expand Down
3 changes: 2 additions & 1 deletion src/types/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export interface Course {
id: string;
name: string;
description: string;
institution?: Institution;
imageUrl: string;
courseType: CourseType;
professor: Professor;
Expand All @@ -54,7 +55,7 @@ export interface CourseType {
}

export interface Institution {
id: string;
institutionId: string;
name: string;
description: string;
normalizedName: string;
Expand Down