mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-09-01 18:35:24 +00:00
Remove octokit (#417)
* remove octokit * clean up .env.sample and gist apis * better error management
This commit is contained in:
@@ -24,7 +24,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { databases } from "../data/databases";
|
||||
import { isRtl } from "../i18n/utils/rtl";
|
||||
import { useSearchParams } from "react-router-dom";
|
||||
import { octokit } from "../data/octokit";
|
||||
import { get } from "../api/gists";
|
||||
|
||||
export const IdContext = createContext({ gistId: "" });
|
||||
|
||||
@@ -285,12 +285,7 @@ export default function WorkSpace() {
|
||||
|
||||
const loadFromGist = async (shareId) => {
|
||||
try {
|
||||
const res = await octokit.request(`GET /gists/${shareId}`, {
|
||||
gist_id: shareId,
|
||||
headers: {
|
||||
"X-GitHub-Api-Version": "2022-11-28",
|
||||
},
|
||||
});
|
||||
const res = await get(shareId);
|
||||
const diagramSrc = res.data.files["share.json"].content;
|
||||
const d = JSON.parse(diagramSrc);
|
||||
setUndoStack([]);
|
||||
|
Reference in New Issue
Block a user