Add bulk poster filling endpoint and enhance show deletion options
Introduced a new endpoint for bulk filling collection posters, allowing for automatic assignment of posters to collections without existing images. Updated the DeleteShowCommand to include an option for cutting shows from future airings, enhancing the deletion process. Refactored related components and API calls to support these features, ensuring a seamless user experience. Additionally, updated localization strings to reflect the new functionalities and adjusted tests to verify correct behavior.
This commit is contained in:
@@ -79,10 +79,17 @@ export function getShowUsage(id: string) {
|
||||
return apiRequest<ShowUsageDto>(`/admin/shows/${id}/usage`)
|
||||
}
|
||||
|
||||
/** `withMedia` — снести заодно файлы шоу: иначе они переживут его осиротевшими. */
|
||||
export function deleteShow(id: string, withMedia = false) {
|
||||
const query = withMedia ? '?withMedia=true' : ''
|
||||
return apiRequest<void>(`/admin/shows/${id}${query}`, { method: 'DELETE' })
|
||||
/**
|
||||
* `withMedia` — снести заодно файлы шоу: иначе они переживут его осиротевшими.
|
||||
* `withSchedule` — вырезать шоу из будущего эфира вместо отказа.
|
||||
*/
|
||||
export function deleteShow(id: string, withMedia = false, withSchedule = false) {
|
||||
const query = new URLSearchParams()
|
||||
if (withMedia) query.set('withMedia', 'true')
|
||||
if (withSchedule) query.set('withSchedule', 'true')
|
||||
const suffix = query.size > 0 ? `?${query.toString()}` : ''
|
||||
|
||||
return apiRequest<void>(`/admin/shows/${id}${suffix}`, { method: 'DELETE' })
|
||||
}
|
||||
|
||||
export function addEpisode(showId: string, mediaAssetId: string) {
|
||||
|
||||
Reference in New Issue
Block a user