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!

improvements: delete data partialy

kruzhambus2eea5388fb61
diff --git a/src/api/index.ts b/src/api/index.ts
index 0068f7634..64a4bda83 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -865,3 +865,17 @@ export const processSSOToken = (token: string, hash: string) =>
? error.response.data
: error.response.data.message
})
+
+export const deletePartially = (id: string, data: {
+ from: string
+ to: string
+}) =>
+ api
+ .delete(`project/partially/${id}?from=${data.from}&to=${data.to}`)
+ .then((response) => response.data)
+ .catch((error) => {
+ debug('%s', error)
+ throw _isEmpty(error.response.data?.message)
+ ? error.response.data
+ : error.response.data.message
+ })