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:
Deluan Quintão
2025-05-22 22:28:10 -04:00
committed by GitHub
parent 992c78376c
commit 3ccc02f375
8 changed files with 119 additions and 17 deletions
+3 -3
View File
@@ -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 || [] }))
}