Merge branch 'staging' into preprod
This commit is contained in:
commit
c67b7d23b5
@ -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 query = { q };
|
||||
Object.entries(query).forEach(([key, value]) => url.searchParams.set(key, JSON.stringify(value)));
|
||||
try {
|
||||
return await this.getRequest<IGetDocumentRemindersCountresponse>(url);
|
||||
} catch (err) {
|
||||
this.onError(err);
|
||||
return Promise.reject(err);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,17 @@ export default function DocumentsReminderHistory(props: IProps) {
|
||||
|
||||
const fetchTotalPages = useCallback(() => {
|
||||
DocumentReminders.getInstance()
|
||||
.count()
|
||||
.count({
|
||||
where: {
|
||||
...(folderUid && {
|
||||
document: {
|
||||
folder: {
|
||||
uid: folderUid as string,
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
const totalPages = Math.ceil(response.count / pageSize);
|
||||
setTotalPages(totalPages);
|
||||
@ -70,6 +80,15 @@ export default function DocumentsReminderHistory(props: IProps) {
|
||||
DocumentReminders.getInstance()
|
||||
.get({
|
||||
...(customerOption && customerOption.id !== "tous" && { where: { document: { depositor: { uid: customerOption.id } } } }),
|
||||
where: {
|
||||
...(folderUid && {
|
||||
document: {
|
||||
folder: {
|
||||
uid: folderUid as string,
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
include: {
|
||||
document: {
|
||||
include: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user