sorting fixes #857

This commit is contained in:
wh1te909 2021-12-13 22:50:16 +00:00
parent c2810e5fe5
commit 4f822878f7
1 changed files with 4 additions and 2 deletions

View File

@ -65,7 +65,9 @@ export function useCheckModal({ editCheck, initialState }) {
async function getAgentServiceOptions() { async function getAgentServiceOptions() {
const { services } = await fetchAgent(check.value.agent) const { services } = await fetchAgent(check.value.agent)
serviceOptions.value = Object.freeze(services.map(service => ({ label: service.display_name, value: service.name })))
const tmp = services.map(service => ({ label: service.display_name, value: service.name }))
serviceOptions.value = Object.freeze(tmp.sort((a, b) => a.label.localeCompare(b.label)))
check.value.svc_name = serviceOptions.value[0].value check.value.svc_name = serviceOptions.value[0].value
check.value.svc_display_name = serviceOptions.value[0].label check.value.svc_display_name = serviceOptions.value[0].label
} }
@ -1194,4 +1196,4 @@ export const defaultServiceOptions = [
value: "tacticalagent", value: "tacticalagent",
label: "Tactical RMM Agent" label: "Tactical RMM Agent"
} }
] ].sort((a, b) => a.label.localeCompare(b.label))