mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-21 14:09:34 +01:00
feat: add issue reporting api endpoint
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import hosts from "../utils/constants";
|
||||
|
||||
export default class Debug {
|
||||
strip(item) {
|
||||
return JSON.stringify({
|
||||
@@ -16,4 +18,15 @@ export default class Debug {
|
||||
additionalData: item.additionalData,
|
||||
});
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user