Skip to content

Commit

Permalink
Move itemsPerPage option to onMounted API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
wssheldon committed Dec 4, 2023
1 parent f4a1935 commit 1adf9c9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const casePriorities: Ref<CasePriority[]> = ref([])
onMounted(async () => {
try {
const response = await CasePriorityApi.getAll()
const options = { itemsPerPage: -1 }
const response = await CasePriorityApi.getAll(options)
casePriorities.value = response.data.items.map((item: any) => item.name)
} catch (error) {
console.error("Error fetching priorities:", error)
Expand All @@ -32,7 +33,6 @@ const selectCasePriority = async (casePriorityName: string) => {
filter: JSON.stringify([
{ and: [{ model: "CasePriority", field: "name", op: "==", value: casePriorityName }] },
]),
itemsPerPage: -1,
})
const caseType = response.data.items[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const caseSeveritys: Ref<CaseSeverity[]> = ref([])
onMounted(async () => {
try {
const response = await CaseSeverityApi.getAll()
const options = { itemsPerPage: -1 }
const response = await CaseSeverityApi.getAll(options)
caseSeveritys.value = response.data.items.map((item: any) => item.name)
} catch (error) {
console.error("Error fetching case severities:", error)
Expand All @@ -32,7 +33,6 @@ const selectCaseSeverity = async (caseSeverityName: string) => {
filter: JSON.stringify([
{ and: [{ model: "CaseSeverity", field: "name", op: "==", value: caseSeverityName }] },
]),
itemsPerPage: -1,
})
const caseSeverity = response.data.items[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const caseTypes: Ref<CaseType[]> = ref([])
onMounted(async () => {
try {
const response = await CaseTypeApi.getAll()
const options = { itemsPerPage: -1 }
const response = await CaseTypeApi.getAll(options)
caseTypes.value = response.data.items.map((item: any) => item.name)
} catch (error) {
console.error("Error fetching case types:", error)
Expand All @@ -32,7 +33,6 @@ const selectCaseType = async (caseTypeName: string) => {
filter: JSON.stringify([
{ and: [{ model: "CaseType", field: "name", op: "==", value: caseTypeName }] },
]),
itemsPerPage: -1,
})
const caseType = response.data.items[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const projects: Ref<Project[]> = ref([])
onMounted(async () => {
try {
const response = await ProjectApi.getAll()
const options = { itemsPerPage: -1 }
const response = await ProjectApi.getAll(options)
projects.value = response.data.items.map((item: any) => item.name)
} catch (error) {
console.error("Error fetching projects:", error)
Expand All @@ -33,7 +34,6 @@ const selectProject = async (projectName: string) => {
filter: JSON.stringify([
{ and: [{ model: "Project", field: "name", op: "==", value: projectName }] },
]),
itemsPerPage: -1,
})
const project = response.data.items[0]
Expand Down

0 comments on commit 1adf9c9

Please sign in to comment.