fix(Response): Ajuste de tipagem no componente de resposta
This commit is contained in:
parent
247371c2d4
commit
0f0121d543
2 changed files with 6 additions and 4 deletions
|
|
@ -3,9 +3,11 @@
|
||||||
import React, { createContext, useContext, useState, ReactNode } from 'react';
|
import React, { createContext, useContext, useState, ReactNode } from 'react';
|
||||||
|
|
||||||
interface ResponseState {
|
interface ResponseState {
|
||||||
message: string;
|
message?: string;
|
||||||
type: 'toast' | 'modal' | 'alert' | null;
|
type?: 'toast' | 'modal' | 'alert' | null;
|
||||||
status: number;
|
status?: number;
|
||||||
|
error?: string;
|
||||||
|
detail?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ResponseContextProps {
|
interface ResponseContextProps {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ export default function Response() {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 422:
|
case 422:
|
||||||
toast.danger(response.error, {
|
toast.error(response.error, {
|
||||||
description: response.detail
|
description: response.detail
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue