feat: save the selected parser to the backend on the upload file page and upload document (#54)
* feat: add pagination to document table * feat: fetch document list by page * feat: poll the document list * feat: upload document * feat: save the selected parser to the backend on the upload file page
This commit is contained in:
@@ -8,20 +8,31 @@ interface IProps {
|
||||
onCancel?: (...args: any[]) => any;
|
||||
}
|
||||
|
||||
export const showDeleteConfirm = ({ onOk, onCancel }: IProps) => {
|
||||
confirm({
|
||||
title: 'Are you sure delete this item?',
|
||||
icon: <ExclamationCircleFilled />,
|
||||
content: 'Some descriptions',
|
||||
okText: 'Yes',
|
||||
okType: 'danger',
|
||||
cancelText: 'No',
|
||||
onOk() {
|
||||
onOk?.();
|
||||
},
|
||||
onCancel() {
|
||||
onCancel?.();
|
||||
},
|
||||
export const showDeleteConfirm = ({
|
||||
onOk,
|
||||
onCancel,
|
||||
}: IProps): Promise<number> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
confirm({
|
||||
title: 'Are you sure delete this item?',
|
||||
icon: <ExclamationCircleFilled />,
|
||||
content: 'Some descriptions',
|
||||
okText: 'Yes',
|
||||
okType: 'danger',
|
||||
cancelText: 'No',
|
||||
async onOk() {
|
||||
try {
|
||||
const ret = await onOk?.();
|
||||
resolve(ret);
|
||||
console.info(ret);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
},
|
||||
onCancel() {
|
||||
onCancel?.();
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user