Ignore:
Timestamp:
02/15/26 23:28:14 (5 months ago)
Author:
Dimitar Arsov <dimitararsov04@…>
Branches:
main
Children:
615dcee, c807e22
Parents:
c8baad1
Message:

create new playlist, delete playlists and add song to playlist on playlist creation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/components/playlist/CreatePlaylistModal.tsx

    rc8baad1 rd1ee039  
    88  onClose,
    99  onSuccess,
     10  songId,
    1011}: CreatePlaylistModalProps) => {
    1112  const [playlistName, setPlaylistName] = useState("");
     
    3940    setIsSubmitting(true);
    4041    try {
    41       await axiosInstance.post(
    42         `/playlists?playlistName=${encodeURIComponent(playlistName.trim())}`,
    43       );
     42      await axiosInstance.post("/playlists", null, {
     43        params: {
     44          playlistName: playlistName.trim(),
     45          ...(songId != null && { songId }),
     46        },
     47      });
     48
    4449      toast.success("Playlist created successfully!");
    45       onSuccess();
     50      await onSuccess();
    4651      handleClose();
    4752    } catch (err: any) {
Note: See TracChangeset for help on using the changeset viewer.