mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-21 14:09:34 +01:00
feat: send userId with github bug report
This commit is contained in:
@@ -19,11 +19,23 @@ export default class Debug {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async report(title, body) {
|
/**
|
||||||
|
*
|
||||||
|
* @param {{
|
||||||
|
* title: string,
|
||||||
|
* body: string,
|
||||||
|
* userId: string
|
||||||
|
* }} reportData
|
||||||
|
* @returns {string} link to the github issue
|
||||||
|
*/
|
||||||
|
async report(reportData) {
|
||||||
|
if (!reportData) return;
|
||||||
|
|
||||||
|
const { title, body, userId } = reportData;
|
||||||
const response = await fetch(`${hosts.ISSUES_HOST}/create/notesnook`, {
|
const response = await fetch(`${hosts.ISSUES_HOST}/create/notesnook`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ title, body }),
|
body: JSON.stringify({ title, body, userId }),
|
||||||
});
|
});
|
||||||
if (!response.ok) return;
|
if (!response.ok) return;
|
||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
|
|||||||
Reference in New Issue
Block a user