Fixed historique de relance
This commit is contained in:
parent
2ca4015399
commit
6039f5f778
@ -45,13 +45,15 @@ export default class DocumentReminders extends BaseNotary {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public count = async (): Promise<IGetDocumentRemindersCountresponse> => {
|
public async count(q: IGetDocumentRemindersparams): Promise<IGetDocumentRemindersCountresponse> {
|
||||||
const url = new URL(this.baseURl.concat("/count"));
|
const url = new URL(this.baseURl.concat("/count"));
|
||||||
|
const query = { q };
|
||||||
|
Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
||||||
try {
|
try {
|
||||||
return await this.getRequest<IGetDocumentRemindersCountresponse>(url);
|
return await this.getRequest<IGetDocumentRemindersCountresponse>(url);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.onError(err);
|
this.onError(err);
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,17 @@ export default function DocumentsReminderHistory(props: IProps) {
|
|||||||
|
|
||||||
const fetchTotalPages = useCallback(() => {
|
const fetchTotalPages = useCallback(() => {
|
||||||
DocumentReminders.getInstance()
|
DocumentReminders.getInstance()
|
||||||
.count()
|
.count({
|
||||||
|
where: {
|
||||||
|
...(folderUid && {
|
||||||
|
document: {
|
||||||
|
folder: {
|
||||||
|
uid: folderUid as string,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
const totalPages = Math.ceil(response.count / pageSize);
|
const totalPages = Math.ceil(response.count / pageSize);
|
||||||
setTotalPages(totalPages);
|
setTotalPages(totalPages);
|
||||||
@ -70,6 +80,15 @@ export default function DocumentsReminderHistory(props: IProps) {
|
|||||||
DocumentReminders.getInstance()
|
DocumentReminders.getInstance()
|
||||||
.get({
|
.get({
|
||||||
...(customerOption && customerOption.id !== "tous" && { where: { document: { depositor: { uid: customerOption.id } } } }),
|
...(customerOption && customerOption.id !== "tous" && { where: { document: { depositor: { uid: customerOption.id } } } }),
|
||||||
|
where: {
|
||||||
|
...(folderUid && {
|
||||||
|
document: {
|
||||||
|
folder: {
|
||||||
|
uid: folderUid as string,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
include: {
|
include: {
|
||||||
document: {
|
document: {
|
||||||
include: {
|
include: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user