Skip to content

Commit

Permalink
count fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maayarosama committed Jan 31, 2024
1 parent 8ea79f6 commit 56c3095
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions client/src/clients/api/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export abstract class ApiClientBase {
}

if (err) {
console.log("err",err)
ApiClientBase.$notifier?.notify({
type: 'error',
description: options.normalizeError?.(err, res) ?? ApiClientBase.normalizeError(err) ?? err
Expand Down
20 changes: 16 additions & 4 deletions client/src/views/UsersView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default {
officeFilters
},
setup() {
const offices = useAsyncState($api.office.list(),[],{ immediate: true })
const offices = useAsyncState($api.office.list(), [], { immediate: true })
const $route = useRoute()
let isFirstLoad = true
const page = ref(1)
Expand All @@ -49,7 +49,11 @@ export default {
{
onSuccess(data) {
if (data?.count) {
count.value = Math.ceil(data?.count / 10)
if (data?.count < 10) {
count.value = 0
} else {
count.value = Math.ceil(data?.count / 10)
}
}
users.execute(undefined, data?.results || [])
}
Expand All @@ -74,7 +78,11 @@ export default {
{
onSuccess(data) {
if (data?.count) {
count.value = Math.ceil(data?.count / 10)
if (data?.count < 10) {
count.value = 0
} else {
count.value = Math.ceil(data?.count / 10)
}
}
users.execute(undefined, data?.results || [])
}
Expand All @@ -92,7 +100,11 @@ export default {
{
onSuccess(data) {
if (data?.count) {
count.value = Math.ceil(data?.count / 10)
if (data?.count < 10) {
count.value = 0
} else {
count.value = Math.ceil(data?.count / 10)
}
}
users.execute(undefined, data?.results || [])
}
Expand Down

0 comments on commit 56c3095

Please sign in to comment.