Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

blog api to ts

kruzhambusb8707cca8798
diff --git a/src/api/blog.js b/src/api/blog.ts
similarity index 84%
rename from src/api/blog.js
rename to src/api/blog.ts
index e038e0060..20e9af455 100644
--- a/src/api/blog.js
+++ b/src/api/blog.ts
@@ -12,7 +12,10 @@ const api = axios.create({
export const getLastPost = () =>
api
.get('last-post?format=json')
- .then((response) => response.data)
+ .then((response): {
+ title: string
+ url_path: string
+ } => response.data)
.catch((error) => {
debug('%s', error)
throw _isEmpty(error.response.data?.message)
diff --git a/src/api/index.ts b/src/api/index.ts
index 3a763a67c..cc185af19 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -735,7 +735,6 @@ export const removeSubscriber = (id: string, subscriberId: string) =>
: error.response.data.message
})
-
export const confirmSubscriberInvite = (id: string, token: string) =>
api
.get(`project/${id}/subscribers/invite?token=${token}`)