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:
@@ -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 || [] }))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user