Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sethsandaru committed Nov 4, 2023
1 parent 8ef7a5d commit 1befef8
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ const paginationMeta = ref(null);
const page = ref(1);
const keyword = ref(null);
const isSearching = ref(false);
const isLoading = ref(false);
const loadRecords = async (forcePage) => {
isLoading.value = true;
page.value = forcePage || page.value;
const documentTemplates = await documentTemplateRepository.index({
Expand All @@ -116,6 +118,8 @@ const loadRecords = async (forcePage) => {
search: keyword.value,
});
isLoading.value = false;
records.value = [...documentTemplates.data];
paginationMeta.value = { ...documentTemplates.meta };
Expand All @@ -133,6 +137,10 @@ const onTemplateDuplicated = (result) =>
loadRecords();
function search() {
if (isLoading.value) {
return;
}
if (!keyword.value) {
// clear search state
if (isSearching.value) {
Expand Down

0 comments on commit 1befef8

Please sign in to comment.