From 516f21cbe79f8bb89ec01cdf741c81c63c477e32 Mon Sep 17 00:00:00 2001 From: dekzter Date: Mon, 7 Apr 2025 18:27:38 -0400 Subject: [PATCH] fixed m3u creation endpoint when using a file --- frontend/src/api.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/api.js b/frontend/src/api.js index 9d8bf746..ee598b6c 100644 --- a/frontend/src/api.js +++ b/frontend/src/api.js @@ -500,7 +500,9 @@ export default class API { static async addPlaylist(values) { let body = null; + let endpoint = `${host}/api/m3u/accounts/`; if (values.file) { + endpoint = `${host}/api/m3u/accounts/upload/`; body = new FormData(); for (const prop in values) { body.append(prop, values[prop]); @@ -511,7 +513,7 @@ export default class API { body = JSON.stringify(body); } - const response = await fetch(`${host}/api/m3u/accounts/`, { + const response = await fetch(endpoint, { method: 'POST', headers: { Authorization: `Bearer ${await API.getAuthToken()}`,