@@ -60,7 +60,7 @@ export const handleCheckForUpdates = () => {
6060 if ( checkUpdateButton ) {
6161 checkUpdateButton . addEventListener ( 'click' , ( event ) => {
6262 event . preventDefault ( ) ;
63- fetch ( window . location . pathname + ' api/update-check', {
63+ fetch ( './ api/update-check', {
6464 method : 'POST' ,
6565 headers : {
6666 Accept : 'application/json, text/plain, */*' ,
@@ -118,7 +118,7 @@ export const handleCheckForUpdates = () => {
118118 version = versionLastChecked . innerText ;
119119 }
120120
121- fetch ( window . location . pathname + ` api/download-package/${ version } `, {
121+ fetch ( `./ api/download-package/${ version } `, {
122122 method : 'POST' ,
123123 headers : {
124124 Accept : 'application/json, text/plain, */*' ,
@@ -158,7 +158,7 @@ export const handleCheckForUpdates = () => {
158158 if ( extractButton ) {
159159 extractButton . addEventListener ( 'click' , ( event ) => {
160160 event . preventDefault ( ) ;
161- fetch ( window . location . pathname + ' api/extract-package', {
161+ fetch ( './ api/extract-package', {
162162 method : 'POST' ,
163163 headers : {
164164 Accept : 'application/json, text/plain, */*' ,
@@ -202,7 +202,7 @@ export const handleCheckForUpdates = () => {
202202} ;
203203
204204const createTemporaryBackup = async ( ) => {
205- await fetch ( window . location . pathname + ' api/create-temporary-backup', {
205+ await fetch ( './ api/create-temporary-backup', {
206206 method : 'POST' ,
207207 headers : {
208208 Accept : 'application/json, text/plain, */*' ,
@@ -241,7 +241,7 @@ const createTemporaryBackup = async () => {
241241} ;
242242
243243const installPackage = async ( ) => {
244- await fetch ( window . location . pathname + ' api/install-package', {
244+ await fetch ( './ api/install-package', {
245245 method : 'POST' ,
246246 headers : {
247247 Accept : 'application/json, text/plain, */*' ,
@@ -282,7 +282,7 @@ const installPackage = async () => {
282282} ;
283283
284284const updateDatabase = async ( ) => {
285- await fetch ( window . location . pathname + ' api/update-database', {
285+ await fetch ( './ api/update-database', {
286286 method : 'POST' ,
287287 headers : {
288288 Accept : 'application/json, text/plain, */*' ,
0 commit comments