Skip to content

Commit

Permalink
[web] Lint source code
Browse files Browse the repository at this point in the history
  • Loading branch information
hacketiwack committed Apr 23, 2024
1 parent 7d7d38b commit b20bdda
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
1 change: 0 additions & 1 deletion web-src/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export default [
'no-shadow': 'off',
'no-ternary': 'off',
'no-undef': 'off',
'no-undefined': 'off',
'no-unused-vars': ['error', { args: 'none', caughtErrors: 'none' }],
'no-useless-assignment': 'off',
'one-var': 'off',
Expand Down
2 changes: 1 addition & 1 deletion web-src/src/lib/GroupedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const timeIndex = (string) => {
return times.find((item) => isNaN(diff) || diff < item.difference)?.text(date)
}

const createIndexer = ({ field, type = undefined } = {}) => {
const createIndexer = ({ field, type } = {}) => {
switch (type) {
case String:
return (item) => characterIndex(item[field])
Expand Down
24 changes: 12 additions & 12 deletions web-src/src/webapi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ export default {
},

library_add(url) {
return axios.post('./api/library/add', undefined, { params: { url } })
return axios.post('./api/library/add', null, { params: { url } })
},

library_album(albumId) {
return axios.get(`./api/library/albums/${albumId}`)
},

library_album_track_update(albumId, attributes) {
return axios.put(`./api/library/albums/${albumId}/tracks`, undefined, {
return axios.put(`./api/library/albums/${albumId}/tracks`, null, {
params: attributes
})
},
Expand Down Expand Up @@ -151,7 +151,7 @@ export default {
},

library_playlist_delete(playlistId) {
return axios.delete(`./api/library/playlists/${playlistId}`, undefined)
return axios.delete(`./api/library/playlists/${playlistId}`, null)
},

library_playlist_folder(playlistId = 0) {
Expand Down Expand Up @@ -189,7 +189,7 @@ export default {
},

library_rescan(scan_kind) {
return axios.put('./api/rescan', undefined, { params: { scan_kind } })
return axios.put('./api/rescan', null, { params: { scan_kind } })
},

library_stats() {
Expand All @@ -205,13 +205,13 @@ export default {
},

library_track_update(trackId, attributes = {}) {
return axios.put(`./api/library/tracks/${trackId}`, undefined, {
return axios.put(`./api/library/tracks/${trackId}`, null, {
params: attributes
})
},

library_update(scan_kind) {
return axios.put('./api/update', undefined, { params: { scan_kind } })
return axios.put('./api/update', null, { params: { scan_kind } })
},

output_toggle(outputId) {
Expand Down Expand Up @@ -253,7 +253,7 @@ export default {
},

player_play(options = {}) {
return axios.put('./api/player/play', undefined, { params: options })
return axios.put('./api/player/play', null, { params: options })
},

player_play_expression(expression, shuffle, position) {
Expand All @@ -264,7 +264,7 @@ export default {
playback_from_position: position,
shuffle
}
return axios.post('./api/queue/items/add', undefined, { params })
return axios.post('./api/queue/items/add', null, { params })
},

player_play_uri(uris, shuffle, position) {
Expand All @@ -275,7 +275,7 @@ export default {
shuffle,
uris
}
return axios.post('./api/queue/items/add', undefined, { params })
return axios.post('./api/queue/items/add', null, { params })
},

player_previous() {
Expand Down Expand Up @@ -350,7 +350,7 @@ export default {

queue_expression_add(expression) {
return axios
.post('./api/queue/items/add', undefined, { params: { expression } })
.post('./api/queue/items/add', null, { params: { expression } })
.then((response) => {
store.dispatch('add_notification', {
text: t('server.appended-tracks', {
Expand All @@ -371,7 +371,7 @@ export default {
params.position = store.getters.now_playing.position + 1
}
return axios
.post('./api/queue/items/add', undefined, { params })
.post('./api/queue/items/add', null, { params })
.then((response) => {
store.dispatch('add_notification', {
text: t('server.appended-tracks', {
Expand All @@ -394,7 +394,7 @@ export default {

queue_save_playlist(name) {
return axios
.post('./api/queue/save', undefined, { params: { name } })
.post('./api/queue/save', null, { params: { name } })
.then((response) => {
store.dispatch('add_notification', {
text: t('server.queue-saved', { name }),
Expand Down

0 comments on commit b20bdda

Please sign in to comment.