mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-20 09:39:58 +02:00
Added error handling; Made querystring helper
This commit is contained in:
parent
e5579b2c33
commit
d9c9289d65
3 changed files with 34 additions and 8 deletions
12
client/mixins/apiRequestHelpers.js
Normal file
12
client/mixins/apiRequestHelpers.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
export default {
|
||||
methods: {
|
||||
buildQuerystring(obj, opts = { includePrefix: false }) {
|
||||
let querystring = Object
|
||||
.entries(obj)
|
||||
.map(([key, val]) => `${encodeURIComponent(key)}=${encodeURIComponent(val)}`)
|
||||
.join('&')
|
||||
|
||||
return (opts.includePrefix ? '?' : '').concat(querystring)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue