fuck
This commit is contained in:
@@ -12,10 +12,12 @@ interface CorrespondentOption {
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
type Identifier = string | number;
|
||||
|
||||
interface UseDocumentCorrespondentActionsArgs {
|
||||
apiClient: ApiClient;
|
||||
correspondents: CorrespondentOption[];
|
||||
handleCorrespondentCreate: (payload: { name: string }) => Promise<CorrespondentOption | null | undefined>;
|
||||
handleCorrespondentCreate: (payload: { name: string }) => Promise<CorrespondentOption | null>;
|
||||
refreshCurrentFolder: () => Promise<void>;
|
||||
notifyApiError: (error: unknown, fallback: string) => void;
|
||||
setStatusMessage: (message: string, variant?: string) => void;
|
||||
@@ -41,10 +43,10 @@ const useDocumentCorrespondentActions = ({
|
||||
|
||||
const handleDocumentCorrespondentAttach = useCallback(
|
||||
async (
|
||||
{ documentId, correspondentId }: { documentId?: string | number | null; correspondentId?: string | number | null },
|
||||
{ documentId, correspondentId }: { documentId: Identifier; correspondentId: Identifier },
|
||||
{ notify = true, refresh = true }: { notify?: boolean; refresh?: boolean } = {},
|
||||
) => {
|
||||
if (!documentId || !correspondentId) {
|
||||
if (documentId == null || correspondentId == null) {
|
||||
throw new Error('Missing document or correspondent.');
|
||||
}
|
||||
try {
|
||||
@@ -70,10 +72,10 @@ const useDocumentCorrespondentActions = ({
|
||||
|
||||
const handleCorrespondentRemove = useCallback(
|
||||
async (
|
||||
{ documentId, correspondentId }: { documentId?: string | number | null; correspondentId?: string | number | null },
|
||||
{ documentId, correspondentId }: { documentId: Identifier; correspondentId: Identifier },
|
||||
{ notify = true, refresh = true }: { notify?: boolean; refresh?: boolean } = {},
|
||||
) => {
|
||||
if (!documentId || !correspondentId) {
|
||||
if (documentId == null || correspondentId == null) {
|
||||
throw new Error('Missing document or correspondent.');
|
||||
}
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user