mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-11 11:57:12 +02:00
feat(ui): add remove all missing files functionality (#4108)
* Add remove all missing files feature * test: update mediafile_repository tests for missing files deletion Signed-off-by: Deluan <deluan@navidrome.org> --------- Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
992c78376c
commit
3ccc02f375
8 changed files with 119 additions and 17 deletions
|
|
@ -36,9 +36,9 @@ const mapResource = (resource, params) => {
|
|||
}
|
||||
|
||||
const callDeleteMany = (resource, params) => {
|
||||
const ids = params.ids.map((id) => `id=${id}`)
|
||||
const idsParam = ids.join('&')
|
||||
return httpClient(`${REST_URL}/${resource}?${idsParam}`, {
|
||||
const ids = (params.ids || []).map((id) => `id=${id}`)
|
||||
const query = ids.length > 0 ? `?${ids.join('&')}` : ''
|
||||
return httpClient(`${REST_URL}/${resource}${query}`, {
|
||||
method: 'DELETE',
|
||||
}).then((response) => ({ data: response.json.ids || [] }))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue