diff --git a/src/app/_response/ResponseContext.tsx b/src/app/_response/ResponseContext.tsx index e4bb515..b387176 100644 --- a/src/app/_response/ResponseContext.tsx +++ b/src/app/_response/ResponseContext.tsx @@ -3,9 +3,11 @@ import React, { createContext, useContext, useState, ReactNode } from 'react'; interface ResponseState { - message: string; - type: 'toast' | 'modal' | 'alert' | null; - status: number; + message?: string; + type?: 'toast' | 'modal' | 'alert' | null; + status?: number; + error?: string; + detail?: string; } interface ResponseContextProps { diff --git a/src/app/_response/response.tsx b/src/app/_response/response.tsx index 4b62195..033c585 100644 --- a/src/app/_response/response.tsx +++ b/src/app/_response/response.tsx @@ -24,7 +24,7 @@ export default function Response() { break; case 422: - toast.danger(response.error, { + toast.error(response.error, { description: response.detail }); break;