mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 18:46:40 -04:00
harder/better/faster/stronger deps
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import fetch from "cross-fetch";
|
||||
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");
|
||||
@ -14,7 +15,7 @@ if (wrapper) {
|
||||
// strip beginning and ending forward slash
|
||||
const slug = canonical.pathname.slice(1, -1);
|
||||
|
||||
fetch("/api/hits/?slug=" + slug)
|
||||
fetch(queryString.stringifyUrl({ url: "/api/hits/", query: { slug: slug } }))
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
if (typeof data.hits !== "undefined") {
|
||||
|
Reference in New Issue
Block a user