chore(webui): Migrate to Quasar 2.x and Vue.js 3.x
This commit is contained in:
parent
153765f99f
commit
f7edb394f2
65 changed files with 4374 additions and 7999 deletions
|
@ -22,7 +22,7 @@ class Errors {
|
|||
|
||||
static handleResponse (error) {
|
||||
console.log('handleResponse', error, error.response)
|
||||
let body = error.response.data
|
||||
const body = error.response.data
|
||||
if (error.response.status === 401) {
|
||||
// TODO - actions...
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { get } from 'dot-prop'
|
||||
import { getProperty } from 'dot-prop'
|
||||
|
||||
class Helps {
|
||||
// Getters
|
||||
|
@ -11,7 +11,7 @@ class Helps {
|
|||
// ------------------------------------------------------------------------
|
||||
|
||||
static get (obj, prop, def = undefined) {
|
||||
return get(obj, prop, def)
|
||||
return getProperty(obj, prop, def)
|
||||
}
|
||||
|
||||
static hasIn (obj, prop) {
|
||||
|
@ -39,13 +39,12 @@ class Helps {
|
|||
}
|
||||
|
||||
static removeEmptyObjects (objects) {
|
||||
const obj = {}
|
||||
Object.entries(objects).map(item => {
|
||||
if (item[1] !== '') {
|
||||
obj[item[0]] = item[1]
|
||||
}
|
||||
})
|
||||
return obj
|
||||
Object.entries(objects)
|
||||
.filter(item => item[1] !== '')
|
||||
.reduce((acc, item) => {
|
||||
acc[item[0]] = item[1]
|
||||
return acc
|
||||
}, {})
|
||||
}
|
||||
|
||||
// Helps -> Numbers
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { set, get } from 'dot-prop'
|
||||
import { setProperty, getProperty } from 'dot-prop'
|
||||
|
||||
export const withPagination = (type, opts = {}) => (state, data) => {
|
||||
const { isSameContext, statePath } = opts
|
||||
const currentState = get(state, statePath)
|
||||
const currentState = getProperty(state, statePath)
|
||||
|
||||
let newState
|
||||
|
||||
|
@ -13,7 +13,7 @@ export const withPagination = (type, opts = {}) => (state, data) => {
|
|||
loading: true
|
||||
}
|
||||
break
|
||||
case 'success':
|
||||
case 'success': {
|
||||
const { body, page } = data
|
||||
newState = {
|
||||
...currentState,
|
||||
|
@ -28,6 +28,7 @@ export const withPagination = (type, opts = {}) => (state, data) => {
|
|||
loading: false
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'failure':
|
||||
newState = {
|
||||
...currentState,
|
||||
|
@ -39,6 +40,6 @@ export const withPagination = (type, opts = {}) => (state, data) => {
|
|||
}
|
||||
|
||||
if (newState) {
|
||||
set(state, statePath, newState)
|
||||
setProperty(state, statePath, newState)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue