mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 17:06:37 -04:00
remove query-string from client side
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import fetch from "cross-fetch";
|
||||
import numeral from "numeral";
|
||||
import * as queryString from "query-string";
|
||||
|
||||
// don't continue if there isn't a span#meta-hits element on this page
|
||||
const wrapper = document.getElementById("meta-hits");
|
||||
@ -16,7 +15,7 @@ if (wrapper) {
|
||||
// strip beginning and ending forward slash
|
||||
const slug = canonical.pathname.slice(1, -1);
|
||||
|
||||
fetch(queryString.stringifyUrl({ url: "/api/hits/", query: { slug: slug } }))
|
||||
fetch(`/api/hits/?slug=${encodeURIComponent(slug)}`)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
if (data.hits) {
|
||||
|
Reference in New Issue
Block a user