feat: add functionality to remove media from album, including API integration and UI context menu
This commit is contained in:
@@ -66,4 +66,18 @@ export const addMediaToAlbum = async (
|
||||
export const getAlbum = async (albumId: string): Promise<Album> => {
|
||||
const { data } = await apiClient.get(`/albums/${albumId}`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export type RemoveMediaFromAlbumPayload = {
|
||||
media_ids: string[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes a list of media IDs from a specific album.
|
||||
*/
|
||||
export const removeMediaFromAlbum = async (
|
||||
albumId: string,
|
||||
payload: RemoveMediaFromAlbumPayload,
|
||||
): Promise<void> => {
|
||||
await apiClient.delete(`/albums/${albumId}/media`, { data: payload });
|
||||
};
|
||||
Reference in New Issue
Block a user