Replace jquery $.param with native URLSearchParams (#2613)

This commit is contained in:
absidue 2022-09-25 01:39:27 +02:00 committed by GitHub
parent c9c522a2b1
commit facbbf6acf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -1,4 +1,3 @@
import $ from 'jquery'
import fs from 'fs' import fs from 'fs'
const state = { const state = {
@ -71,7 +70,7 @@ const actions = {
invidiousAPICall({ state }, payload) { invidiousAPICall({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const requestUrl = state.currentInvidiousInstance + '/api/v1/' + payload.resource + '/' + payload.id + '?' + $.param(payload.params) const requestUrl = state.currentInvidiousInstance + '/api/v1/' + payload.resource + '/' + payload.id + '?' + new URLSearchParams(payload.params).toString()
fetch(requestUrl) fetch(requestUrl)
.then((response) => response.json()) .then((response) => response.json())