2021-11-24 11:40:33 +05:00
|
|
|
import hosts from "../utils/constants";
|
|
|
|
|
|
2021-09-15 11:47:10 +05:00
|
|
|
export default class Debug {
|
|
|
|
|
strip(item) {
|
|
|
|
|
return JSON.stringify({
|
2021-09-15 12:01:10 +05:00
|
|
|
title: !!item.title,
|
|
|
|
|
description: !!item.description,
|
|
|
|
|
headline: !!item.headline,
|
|
|
|
|
colored: !!item.color,
|
2021-09-15 11:47:10 +05:00
|
|
|
type: item.type,
|
|
|
|
|
notebooks: item.notebooks,
|
|
|
|
|
tags: item.tags,
|
|
|
|
|
id: item.id,
|
|
|
|
|
contentId: item.contentId,
|
|
|
|
|
dateEdited: item.dateEdited,
|
|
|
|
|
dateDeleted: item.dateDeleted,
|
|
|
|
|
dateCreated: item.dateCreated,
|
2021-09-15 12:01:10 +05:00
|
|
|
additionalData: item.additionalData,
|
2021-09-15 11:47:10 +05:00
|
|
|
});
|
|
|
|
|
}
|
2021-11-24 11:40:33 +05:00
|
|
|
|
|
|
|
|
async report(title, body) {
|
|
|
|
|
const response = await fetch(`${hosts.ISSUES_HOST}/create/notesnook`, {
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: { "Content-Type": "application/json" },
|
|
|
|
|
body: JSON.stringify({ title, body }),
|
|
|
|
|
});
|
|
|
|
|
if (!response.ok) return;
|
|
|
|
|
const json = await response.json();
|
|
|
|
|
return json.url;
|
|
|
|
|
}
|
2021-09-15 11:47:10 +05:00
|
|
|
}
|